mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
rpc: disallow in-mempool prioritisation of dusty tx
This commit is contained in:
parent
e1d3e81ab4
commit
4e68f90139
1 changed files with 10 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <node/context.h>
|
||||
#include <node/miner.h>
|
||||
#include <node/warnings.h>
|
||||
#include <policy/ephemeral_policy.h>
|
||||
#include <pow.h>
|
||||
#include <rpc/blockchain.h>
|
||||
#include <rpc/mining.h>
|
||||
|
@ -491,7 +492,15 @@ static RPCHelpMan prioritisetransaction()
|
|||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Priority is no longer supported, dummy argument to prioritisetransaction must be 0.");
|
||||
}
|
||||
|
||||
EnsureAnyMemPool(request.context).PrioritiseTransaction(hash, nAmount);
|
||||
CTxMemPool& mempool = EnsureAnyMemPool(request.context);
|
||||
|
||||
// Non-0 fee dust transactions are not allowed for entry, and modification not allowed afterwards
|
||||
const auto& tx = mempool.get(hash);
|
||||
if (tx && HasDust(tx, mempool.m_opts.dust_relay_feerate)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Priority is not supported for transactions with dust outputs.");
|
||||
}
|
||||
|
||||
mempool.PrioritiseTransaction(hash, nAmount);
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue