mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-21 19:34:20 +02:00
308b76732fFix bug around transaction requests (Suhas Daftuar)f635a3ba11Expire old entries from the in-flight tx map (Suhas Daftuar)e32e08407eRemove NOTFOUND transactions from in-flight data structures (Suhas Daftuar)23163b7593Add an explicit memory bound to m_tx_process_time (Suhas Daftuar)218697b645Improve NOTFOUND comment (Suhas Daftuar) Pull request description: #14897 introduced several bugs that could lead to a node no longer requesting transactions from one or more of its peers. Credit to ajtowns for originally reporting many of these bugs along with an originally proposed fix in #15776. This PR does a few things: - Fix a bug in NOTFOUND processing, where the in-flight map for a peer was keeping transactions it shouldn't - Eliminate the possibility of a memory attack on the CNodeState `m_tx_process_time` data structure by explicitly bounding its size - Remove entries from a peer's in-flight map after 10 minutes, so that we should always eventually resume transaction requests even if there are other bugs like the NOTFOUND one - Fix a bug relating to the coordination of request times when multiple peers announce the same transaction The expiry mechanism added here is something we'll likely want to remove in the future, but is belt-and-suspenders for now to try to ensure we don't have other bugs that could lead to transaction relay failing due to some unforeseen conditions. ACKs for commit 308b76: ajtowns: utACK308b76732fmorcos: light ACK308b767laanwj: Code review ACK308b76732fjonatack: Light ACK308b76732f. jamesob: ACK308b76732fMarcoFalke: ACK308b76732f(Tested two of the three bugs this pull fixes, see comment above) jamesob: Concept ACK308b76732fMarcoFalke: ACK308b76732fTree-SHA512: 8865dca5294447859d95655e8699085643db60c22f0719e76e961651a1398251bc932494b68932e33f68d4f6084579ab3bed7d0e7dd4ac6c362590eaf9414eda