I was messing around with min relay policies and found that under certain circumstances the mempool will accept things, then not relay to any peers.
Example made using wallet: Transaction of size 6195, fee of 619 satoshis, minrelay of 100 satoshis per kvB. Mempool logic allows it:
// No transactions are allowed below minRelayTxFee except from disconnected blocks
if (!bypass_limits && nModifiedFees < ::minRelayTxFee.GetFee(nSize)) {
return state.DoS(0, false, REJECT_INSUFFICIENTFEE, "min relay fee not met", false, strprintf("%d < %d", nModifiedFees, ::minRelayTxFee.GetFee(nSize)));
}
and lets it into mempool
but in net_processing.cpp:
if (filterrate && txinfo.feeRate.GetFeePerK() < filterrate) {
continue;
}
this gets hit because the computed feerate is insufficient(printing I added):
0.00000099 BTC/kB
I'm not super at arithmetic so I'm opening this up in case someone has an easy fix.
let me also get a reproducible test failure with this...