Improve CWalletTx::IsConfirmed performance. #2952

pull pstratem wants to merge 4 commits into bitcoin:master from pstratem:isconfirmed changing 2 files +69 −42
  1. pstratem commented at 5:16 PM on August 29, 2013: contributor

    Build a cache of already processed transactions is sufficient to fix this.CWalletTx::IsConfirmed displays exceptionally poor performance when there are multiple unconfirmed transactions where IsFromMe() is true.

    A cache of already processed transactions is sufficient to largely fix this.

    This is still optimized for the common case where most dependent transactions are not IsFromMe()

    As part of this change the logic has been simplified.

    Simple benchmark results:

    generate 200 blocks with regtest, create 300 transactions using standard sendtoaddress rpc and a new address for each transaction

    95 seconds

    for the IsConfirmed this is replacing... well it still hasn't finished running at transactions 216 1414 seconds and getting worse

    isconfirmed

    after transaction 175 the time per transaction grows exponentially 1.25 * e ^ (0.107 * x)

  2. Move CWalletTx::IsConfirmed to wallet.cpp 9ec8006998
  3. Improve CWalletTx::IsConfirmed performance.
    Build a cache of already processed transactions is sufficient to fix this.
    d2c7d60a47
  4. Search both mapWallet and vtxPrev for dependent transactions 3214be2eb1
  5. Further improve performance of IsConfirmed.
    replace setAlreadyDone with setAlreadyQueued
    a64565da35
  6. BitcoinPullTester commented at 2:08 PM on September 1, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/a64565da35a46a82d791455c15219f38ab83b14b for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  7. pstratem commented at 6:22 AM on October 13, 2013: contributor

    #2966 is the preferred solution

  8. pstratem closed this on Oct 13, 2013

  9. Bushstar referenced this in commit 276b6e3a82 on Apr 8, 2020
  10. 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 00:16 UTC

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