-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Only use AddInventoryKnown for transactions #7960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
filterInventoryKnown is only used when relaying transactions, so stop adding block hashes to the filter.
May as well skip in the fBlocksOnly case too? |
Agree, seems to be no reason to add it to AddInventoryKnown in that case. |
Concept ACK |
Yeah, I think that makes sense. I thought at first that maybe we'd want I was thinking we could probably use a p2p regression test that exercises I'll plan to update this PR at some point with a test and the change for the |
utACK 383fc10 |
utACK. I think blocks only will later be generalized to more degrees than just literally blocks only yes or no, and we probably shouldn't go around adding too much specialization in the codebase for a global blocks only mode unless it's a pretty big win. (and maybe saving the memory of ever allocating some transaction related filters in the first place might be... but insertions? not so much) |
Ok I'll leave this alone then. |
Given that the scope of AddInventoryKnown changes, perhaps it should be renamed to AddInventoryTxKnown, and only take a uint256 rather than a CInv? That may reduce confusion in upcoming refactors. |
Lightly tested ACK. Setup: two mainnet full nodes with this patch (A publicly reachable, B -connect'ed to A) and a lightweight node C (connected to the public network). Tested block synchronization/relay of B from A, relay of transactions to from A to B, relay of newly created transactions by B and C through A. Nothing unusual. |
383fc10 Only use AddInventoryKnown for transactions (Suhas Daftuar)
383fc10 Only use AddInventoryKnown for transactions (Suhas Daftuar)
This should have been part of Bitcoin bitcoin#7960 but was missed in merge conflict resolution.
383fc10 Only use AddInventoryKnown for transactions (Suhas Daftuar)
This should have been part of Bitcoin bitcoin#7960 but was missed in merge conflict resolution.
ZIP 239 preparations 4 Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#5913 - Replaces #3111. - Includes an extra commit included by upstream in the merge outside the PR. - bitcoin/bitcoin#6519 - bitcoin/bitcoin#7179 - bitcoin/bitcoin#7853 - bitcoin/bitcoin#7960
filterInventoryKnown
is only used when relaying transactions, so stop adding block hashes to the filter.Also updates a comment that is no longer correct.