diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c1af397872c..006ec3c78c7 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -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; }, };