diff --git a/src/confidential_validation.cpp b/src/confidential_validation.cpp index 62190a92fd6..1d902565f72 100644 --- a/src/confidential_validation.cpp +++ b/src/confidential_validation.cpp @@ -1,4 +1,5 @@ +#include #include #include #include @@ -28,14 +29,18 @@ bool HasValidFee(const CTransaction& tx) { CAmountMap totalFee; for (unsigned int i = 0; i < tx.vout.size(); i++) { CAmount fee = 0; - if (tx.vout[i].IsFee()) { + if (tx.vout[i].IsFee() && tx.vout[i].nAsset.GetAsset() == Params().GetConsensus().pegged_asset) { fee = tx.vout[i].nValue.GetAmount(); - if (fee == 0 || !MoneyRange(fee)) + if (fee == 0 || !MoneyRange(fee)) { return false; + } totalFee[tx.vout[i].nAsset.GetAsset()] += fee; if (!MoneyRange(totalFee)) { return false; } + if(fee < 0) { + return false; + } } } return true; diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index afbcfbaaa57..770ca9a9bbf 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -14,6 +14,7 @@ #include