| 26 | } |
| 27 | |
| 28 | bool HasValidFee(const CTransaction& tx) { |
| 29 | CAmountMap totalFee; |
| 30 | for (unsigned int i = 0; i < tx.vout.size(); i++) { |
| 31 | CAmount fee = 0; |
| 32 | if (tx.vout[i].IsFee()) { |
| 33 | fee = tx.vout[i].nValue.GetAmount(); |
| 34 | if (fee == 0 || !MoneyRange(fee)) { |
| 35 | return false; |
| 36 | } |
| 37 | totalFee[tx.vout[i].nAsset.GetAsset()] += fee; |
| 38 | if (!MoneyRange(totalFee)) { |
| 39 | return false; |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | CAmountMap GetFeeMap(const CTransaction& tx) { |
| 47 | CAmountMap fee; |
no test coverage detected