I found it surprising that we don’t care if a peer sends us a transaction with fee lower than the fee filter we send them. This is in the spec for BIP 133 so it’s not a bug. But it seems like we send fee filters to limit resource usage and if we don’t care when peers violate it, it’s kind of ineffective. I can see why we wouldn’t want to severely punish - particularly because it’s possible that they’re responding to a GETDATA
we sent before the FEEFILTER
.
This PR adds Misbehaving(1)
when peers send us transactions that get rejected for fee-related mempool policy and the fee is lower than the feefilter we sent them. This means they get disconnected after 100 of these transactions. Hopefully this seems reasonable.
(Note that the first commit is from a refactor from #20833… I needed it to check the fee after calling ATMP).