MCPcopy Create free account
hub / github.com/ElementsProject/elements / HasValidFee

Function HasValidFee

src/confidential_validation.cpp:28–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28bool 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
46CAmountMap GetFeeMap(const CTransaction& tx) {
47 CAmountMap fee;

Callers 2

transactions.cppFile · 0.85
CheckTxInputsMethod · 0.85

Calls 5

IsFeeMethod · 0.80
GetAmountMethod · 0.80
GetAssetMethod · 0.80
MoneyRangeFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected