|
10 | 10 | #include "alert.h"
|
11 | 11 | #include "arith_uint256.h"
|
12 | 12 | #include "bdap/domainentrydb.h"
|
| 13 | +#include "bdap/fees.h" |
13 | 14 | #include "bdap/linking.h"
|
14 | 15 | #include "bdap/linkingdb.h"
|
15 | 16 | #include "bdap/utils.h"
|
@@ -1034,6 +1035,16 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
1034 | 1035 |
|
1035 | 1036 | CAmount nValueOut = tx.GetValueOut();
|
1036 | 1037 | CAmount nFees = nValueIn - nValueOut;
|
| 1038 | + CAmount nBDAPBurn = 0; |
| 1039 | + if (tx.nVersion == BDAP_TX_VERSION) { |
| 1040 | + // Since fees are burned, count BDAP burn funds into fee calculation |
| 1041 | + CAmount nOpCodeAmount; |
| 1042 | + ExtractAmountsFromTx(MakeTransactionRef(tx), nBDAPBurn, nOpCodeAmount); |
| 1043 | + if (nBDAPBurn > 0) |
| 1044 | + nFees += nBDAPBurn; |
| 1045 | + |
| 1046 | + LogPrintf("%s -- BDAP Burn Amount %d, Total Fees %d, BDAP Deposit Amount %d\n", __func__, FormatMoney(nBDAPBurn), FormatMoney(nFees), FormatMoney(nOpCodeAmount)); |
| 1047 | + } |
1037 | 1048 | // nModifiedFees includes any fee deltas from PrioritiseTransaction
|
1038 | 1049 | CAmount nModifiedFees = nFees;
|
1039 | 1050 | double nPriorityDummy = 0;
|
@@ -1096,7 +1107,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
1096 | 1107 | dFreeCount += nSize;
|
1097 | 1108 | }
|
1098 | 1109 |
|
1099 |
| - if (nAbsurdFee && nFees > nAbsurdFee) |
| 1110 | + if (nAbsurdFee && nFees - nBDAPBurn > nAbsurdFee) |
1100 | 1111 | return state.Invalid(false,
|
1101 | 1112 | REJECT_HIGHFEE, "absurdly-high-fee",
|
1102 | 1113 | strprintf("%d > %d", nFees, nAbsurdFee));
|
|
0 commit comments