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.
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-
CodeShark commented at 8:52 PM on January 23, 2013: contributor
-
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.
BitcoinPullTester commented at 1:33 AM on January 24, 2013: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/52c4988344ccaa8b2d400f3c15f66460fcd3149a for binaries and test log.
BitcoinPullTester commented at 4:05 PM on February 5, 2013: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/128599e1d27aa47985d6fc8997a2d41ffe77867d for binaries and test log.
jgarzik commented at 6:54 PM on June 19, 2013: contributorACK
sipa commented at 5:20 PM on June 22, 2013: memberPlease rebase.
Added locks on the setpwalletRegistered functions in main.cpp and added an UnregisterAllWallets function. e5cefb9be1Calling UnregisterAllWallets() instead of UnregisterWallet(pwalletMain) in init.cpp e6fe8e77fbsipa commented at 12:06 AM on June 25, 2013: memberACK
sipa referenced this in commit 4ad73c6b08 on Jun 25, 2013sipa merged this on Jun 25, 2013sipa closed this on Jun 25, 2013DrahtBot locked this on Sep 8, 2021Contributors
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 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
More mirrored repositories can be found on mirror.b10c.me