Page MenuHomePhabricator

net: Remove forcerelay of rejected txs
Changes PlannedPublic

Authored by PiRK on Thu, Jul 22, 14:33.


Group Reviewers
Restricted Project

This removes the code that supposedly handled the forced relay of txs from a permissioned peer that were rejected from our mempool. The removal should be fine, because it is dead code for the following reasons:

  • While RelayTransaction enqueues the inv for all peers, the inv is never processed because it can not be found in the mempool.
  • Even if the peers we intended to send the inv to can somehow reply with a getdata to the never-received inv, they won't receive the tx as a reply because it was never added to the "relay memory" (mapRelay)

This feature was (intentionally or accidentally) removed in 4d8993b, which was released in Bitcoin Core 0.13.0. So all currently supported versions of Bitcoin Core ship without this feature. I am not aware of any complaints about this feature or actual documented use-cases. So instead of reviving an unneeded feature, just remove the dead code.

This is a backport of core#17985

Some comments were already updated on our side via D9325 and D9042.
A test from core#17984, that we didn't backport probably because it seemed segwit related, had to be included to make this new test work. So we also gain a tx relay test for whitelisted peers.

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Thu, Jul 22, 14:33
Fabien requested changes to this revision.Fri, Jul 23, 06:46
Fabien added a subscriber: Fabien.

Please backport 17984 in its own diff, it's difficult to make sure that nothing is missing here



This revision now requires changes to proceed.Fri, Jul 23, 06:46
PiRK planned changes to this revision.Fri, Jul 23, 09:35

needs backporting 17984