Wallet registration locks in main.cpp + UnregisterAllWallet() function #2209

pull CodeShark wants to merge 2 commits into bitcoin:master from CodeShark:WalletRegistrationLocks changing 3 files +17 −1
  1. CodeShark commented at 8:52 PM on January 23, 2013: contributor

    Right now in the current master these hooks aren't really being used - a single wallet is registered at startup in init.cpp and is unregistered at shutdown, also in init.cpp. But in order to support dynamic loading and unloading of transaction listeners, it is necessary to lock these functions. It is also convenient to have an UnregisterAllWallets() function and to call that upon shutdown instead of just calling it on the single main wallet that master currently has.

  2. in src/main.cpp:None in 4f3c3d963e outdated
      91 | @@ -92,9 +92,16 @@ void UnregisterWallet(CWallet* pwalletIn)
      92 |      }
      93 |  }
      94 |  
      95 | +void UnregisterAllWallets()
      96 | +{
      97 | +    LOCK(cs_setpwalletRegistered);
    


    Diapolo commented at 9:00 PM on January 23, 2013:

    Is cs_setpwalletRegistered allready defined somewhere? Just a quick question ^^.


    CodeShark commented at 10:53 PM on January 23, 2013:

    Yes, in fact this already existed in master HEAD...but only RegisterWallet() and UnregisterWallet() were using the lock.

  3. BitcoinPullTester commented at 1:33 AM on January 24, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/52c4988344ccaa8b2d400f3c15f66460fcd3149a for binaries and test log.

  4. BitcoinPullTester commented at 4:05 PM on February 5, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/128599e1d27aa47985d6fc8997a2d41ffe77867d for binaries and test log.

  5. jgarzik commented at 6:54 PM on June 19, 2013: contributor

    ACK

  6. sipa commented at 5:20 PM on June 22, 2013: member

    Please rebase.

  7. Added locks on the setpwalletRegistered functions in main.cpp and added an UnregisterAllWallets function. e5cefb9be1
  8. Calling UnregisterAllWallets() instead of UnregisterWallet(pwalletMain) in init.cpp e6fe8e77fb
  9. sipa commented at 12:06 AM on June 25, 2013: member

    ACK

  10. sipa referenced this in commit 4ad73c6b08 on Jun 25, 2013
  11. sipa merged this on Jun 25, 2013
  12. sipa closed this on Jun 25, 2013

  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-05-02 21:15 UTC

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