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
  1. sipa commented at 5:04 PM on November 1, 2012: member

    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.

  2. 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.
    5eaf91a428
  3. jgarzik commented at 5:09 PM on November 1, 2012: contributor

    ACK

  4. 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.

  5. 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.

  6. gavinandresen commented at 9:02 PM on November 1, 2012: contributor

    ACK

  7. 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.

  8. sipa referenced this in commit a56d3f8a10 on Nov 3, 2012
  9. sipa merged this on Nov 3, 2012
  10. sipa closed this on Nov 3, 2012

  11. laudney referenced this in commit ea839c71c8 on Mar 19, 2014
  12. KolbyML referenced this in commit 98d2443c2e on Dec 5, 2020
  13. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me