discount: implement mempool logic

This commit is contained in:
Byron Hambly 2024-05-09 10:02:57 +02:00
parent 9cbd3e0f05
commit b7b2288a74
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
5 changed files with 96 additions and 11 deletions

View file

@ -914,7 +914,9 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
// No transactions are allowed below minRelayTxFee except from disconnected
// blocks
if (!bypass_limits && !CheckFeeRate(ws.m_vsize, ws.m_modified_fees, state)) return false;
// ELEMENTS: accept discounted fees for Confidential Transactions only, if enabled.
int64_t package_size = Params().GetAcceptDiscountCT() ? GetDiscountVirtualTransactionSize(tx) : ws.m_vsize;
if (!bypass_limits && !CheckFeeRate(package_size, ws.m_modified_fees, state)) return false;
ws.m_iters_conflicting = m_pool.GetIterSet(ws.m_conflicts);
// Calculate in-mempool ancestors, up to a limit.