diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-10 19:54:45 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-10 20:38:19 +0200 |
commit | 85fa648c857f5830fbc748e857b122515d1eb6d1 (patch) | |
tree | bd93a17d7e7540e3ce7b186002fd862640aa0ae3 /src/netaddress.cpp | |
parent | 6d5a9fec2d576bdb17ff612e421a8c94dc362fbe (diff) | |
parent | 4c0731f9c50b0556f8a57b912c8f295c7a9ea89c (diff) |
Merge #19596: Deduplicate parent txid loop of requested transactions and missing parents of orphan transactions
4c0731f9c50b0556f8a57b912c8f295c7a9ea89c Deduplicate missing parents of orphan transactions (Suhas Daftuar)
81961762439fb72fc2ef168164689ddc29d7ef94 Rewrite parent txid loop of requested transactions (Suhas Daftuar)
Pull request description:
I noticed a couple of places recently where we loop over all inputs of a transaction in order to do some processing on the txids we find in those inputs. There may be thousands of inputs in a transaction, and the same txid may appear many times. In a couple of places in particular, we loop over those txids and add them to a rolling bloom filter; doing that multiple times for the same txid wastes entries in that filter.
This PR fixes that in two places relating to transaction relay: one on the server side, where we look for parent transactions of a tx that we are delivering to a peer to ensure that getdata requests for those parents will succeed; and the other on the client side, where when we process an orphan tx we want to loop over the parent txids and ensure that all are eventually requested from the peer who provided the orphan.
This addresses a couple of [related](https://github.com/bitcoin/bitcoin/pull/19109#discussion_r455197217) [comments](https://github.com/bitcoin/bitcoin/pull/19109#discussion_r456820373) left in #19109.
ACKs for top commit:
laanwj:
Code review ACK 4c0731f9c50b0556f8a57b912c8f295c7a9ea89c
jonatack:
ACK 4c0731f9c50b0556f8a57b912c8f295c7a9ea89c
ajtowns:
ACK 4c0731f9c50b0556f8a57b912c8f295c7a9ea89c
Tree-SHA512: 8af9df7f56c6e54b5915519d7d5465e081473ceb1bcc89bbebf83e78722cf51ff58145e588cf57126bce17071a8053273f4bcef0ad8166bec83ba14352e40f5d
Diffstat (limited to 'src/netaddress.cpp')
0 files changed, 0 insertions, 0 deletions