The original test (checking whether the transaction occurs in the txindex) is not usable anymore, as it will miss anything already fully spent. However, as merkle transactions (and by extension, wallet transactions) track which block they were last seen being included in, we can use that to determine the need for rebroadcasting.
Bugfix: do not keep relaying spent wallet transactions #1971
pull sipa wants to merge 1 commits into bitcoin:master from sipa:bugfix_norelayspent changing 1 files +5 −9-
sipa commented at 5:04 PM on November 1, 2012: member
-
5eaf91a428
Bugfix: do not keep relaying spent wallet transactions
The original test (checking whether the transaction occurs in the txindex) is not usable anymore, as it will miss anything already fully spent. However, as merkle transactions (and by extension, wallet transactions) track which block they were last seen being included in, we can use that to determine the need for rebroadcasting.
-
jgarzik commented at 5:09 PM on November 1, 2012: contributor
ACK
-
gmaxwell commented at 5:16 PM on November 1, 2012: contributor
running an iteration over all blocks for each transaction every time relay transactions is called may eventually become slow for wallets with a great many transactions. ACK though, since improving that sounds hard and I don't see it being an immediate issue.
-
sipa commented at 5:24 PM on November 1, 2012: member
@gmaxwell It's a loop over all wallet transactions, the transactions contain the hash of the block they are encoded in, and those just require a lookup in mapBlockIndex to know whether this means they are confirmed. So it's a O(n_wallet_tx * log(blocks_in_history)) operation.
-
gavinandresen commented at 9:02 PM on November 1, 2012: contributor
ACK
-
BitcoinPullTester commented at 9:37 AM on November 2, 2012: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/5eaf91a4286380e5db239b63477b627ab91a53e7 for binaries and test log.
- sipa referenced this in commit a56d3f8a10 on Nov 3, 2012
- sipa merged this on Nov 3, 2012
- sipa closed this on Nov 3, 2012
- laudney referenced this in commit ea839c71c8 on Mar 19, 2014
- KolbyML referenced this in commit 98d2443c2e on Dec 5, 2020
- DrahtBot locked this on Sep 8, 2021