RPC: Add maxfeerate and maxburnamount args to submitpackage

And thread the feerate value through ProcessNewPackage to
reject individual transactions that exceed the given
feerate. This allows subpackage processing, and is
compatible with future package RBF work.
This commit is contained in:
Greg Sanders
2023-11-27 14:50:55 -05:00
parent 45b2a91897
commit 38f70ba6ac
9 changed files with 124 additions and 30 deletions

View File

@@ -26,6 +26,12 @@ struct NodeContext;
*/
static const CFeeRate DEFAULT_MAX_RAW_TX_FEE_RATE{COIN / 10};
/** Maximum burn value for sendrawtransaction, submitpackage, and testmempoolaccept RPC calls.
* By default, a transaction with a burn value higher than this will be rejected
* by these RPCs and the GUI. This can be overridden with the maxburnamount argument.
*/
static const CAmount DEFAULT_MAX_BURN_AMOUNT{0};
/**
* Submit a transaction to the mempool and (optionally) relay it to all P2P peers.
*