This PR adds missing test coverage for the -dustrelayfee
setting, which specifies the fee-rate used to define dust. Output scripts for all common types that are treated as standard by default (P2PK, P2(W)PKH, P2(W)SH, P2TR, bare multisig, null data, unknown witness versions v2+) are created and then checked for dust-mempool-policy each via the testmempoolaccept
RPC: a tx with an output’s nValue equal to the dust threshold should be accepted, one with an nValue of just one 1 satoshi below that should be rejected with reason dust
. This is repeatedly done for a fixed (but obviously somewhat arbitrary) list of different -dustrelayfee
settings on a single node, including the default and zero (i.e. no dust limit) settings.
Note that the first commit introduces a necessary CScript
helper method IsWitnessProgram
(using PascalCase in Python is likely controversial; in this case the style for the already existing method GetSigOpCount
was followed, which also refers to a method in the core CScript
class).
Some historical information about dust, contributed by pablomartin4btc: “The concept of dust was first introduced in #2577. This commit from #9380 introduced the -dustrelayfee option. Previous to that PR, the dust feerate was whatever -minrelaytxfee was set to.”