Further encapsulation.
Move CWallet::setKeyPool to private section of CWallet. #8445
pull pstratem wants to merge 2 commits into bitcoin:master from pstratem:2016-07-01-cwallet-api-cleanup changing 4 files +26 −18-
pstratem commented at 12:18 AM on August 2, 2016: contributor
-
in src/init.cpp:None in 674b2dec4a outdated
1438 | @@ -1439,7 +1439,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) 1439 | LogPrintf("mapBlockIndex.size() = %u\n", mapBlockIndex.size()); 1440 | LogPrintf("nBestHeight = %d\n", chainActive.Height()); 1441 | #ifdef ENABLE_WALLET 1442 | - LogPrintf("setKeyPool.size() = %u\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0); 1443 | + LogPrintf("setKeyPool.size() = %u\n", pwalletMain ? pwalletMain->GetKeyPool().size() : 0);
jonasschnelli commented at 7:44 AM on August 2, 2016:does copy the
std::set<int64_t>but no keys are copied around. Seems to be okay.
sipa commented at 11:24 PM on August 2, 2016:This will copy the entire set. Perhaps a GetKeyPoolSize()?
jonasschnelli commented at 7:45 AM on August 2, 2016: contributorutACK 674b2dec4a9a1ebbdb03d6eac0f4c858ca8793ba
jonasschnelli added the label Refactoring on Aug 2, 2016jonasschnelli added the label Wallet on Aug 2, 2016in src/wallet/wallet.h:None in 674b2dec4a outdated
600 | + std::set<int64_t> GetKeyPool() 601 | + { 602 | + return setKeyPool; 603 | + } 604 | + 605 | + void LoadKeyPool(int nIndex, CKeyPool &keypool)
paveljanik commented at 7:46 AM on August 2, 2016:const keypool?
phantomcircuit commented at 1:07 AM on August 3, 2016:Indeed this should be const
pstratem force-pushed on Aug 8, 2016pstratem commented at 2:59 AM on August 8, 2016: contributornits picked
MarcoFalke commented at 7:20 AM on August 8, 2016: memberFails with
Assertion failed: lock cs_wallet not held in ../../src/wallet/wallet.h:849; locks held:phantomcircuit commented at 10:39 PM on August 9, 2016: noneIndeed it does, the logic in master should be acquiring that lock but is not...
I will correct this oversight.
On Aug 8, 2016 12:21 AM, "MarcoFalke" notifications@github.com wrote:
Fails with
Assertion failed: lock cs_wallet not held in ../../src/wallet/wallet.h:849; locks held:
— You are receiving this because you commented. Reply to this email directly, view it on GitHub #8445 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAlvMVibAOtkoEciHx4xar3TKzTbnD44ks5qdtjdgaJpZM4JaH5I .
pstratem force-pushed on Aug 17, 2016pstratem force-pushed on Aug 17, 2016Move CWallet::setKeyPool to private section of CWallet e86eb71604pstratem force-pushed on Aug 17, 2016pstratem commented at 5:10 AM on August 18, 2016: contributor@MarcoFalke I've fixed that (indeed we were accessing the private class members without the proper lock before).
Ignore the travis error that's a travis error but a pr error.
in src/init.cpp:None in e86eb71604 outdated
1438 | @@ -1439,9 +1439,12 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) 1439 | LogPrintf("mapBlockIndex.size() = %u\n", mapBlockIndex.size()); 1440 | LogPrintf("nBestHeight = %d\n", chainActive.Height()); 1441 | #ifdef ENABLE_WALLET 1442 | - LogPrintf("setKeyPool.size() = %u\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0); 1443 | - LogPrintf("mapWallet.size() = %u\n", pwalletMain ? pwalletMain->mapWallet.size() : 0); 1444 | - LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); 1445 | + if (pwalletMain) {
MarcoFalke commented at 6:21 PM on August 18, 2016:Nit:
if (!fDisableWallet)works as well. No strong opinion.Weak NACK: The goal was to move them into the wallet module. See #7965
MarcoFalke commented at 6:22 PM on August 18, 2016: memberConcept ACK e86eb71604e73ad35b8b1f59d73af22e353a156e
pstratem commented at 10:54 PM on August 19, 2016: contributor@MarcoFalke This should mostly address your concern.
pstratem force-pushed on Aug 20, 2016MarcoFalke commented at 6:34 AM on August 20, 2016: memberMissing lock:
Assertion failed: lock cs_wallet not held in ../../src/wallet/wallet.h:849; locks held:pstratem force-pushed on Aug 20, 2016Move wallet initialization logic from AppInit2 to CWallet::InitLoadWallet 8680d3aa80pstratem force-pushed on Aug 20, 2016pstratem commented at 10:00 PM on August 20, 2016: contributor@MarcoFalke something weird and broken was happening there, I've reduced the scope in which the lock is held and now it works fine...
MarcoFalke commented at 11:37 AM on August 21, 2016: memberutACK 8680d3aa800aa4fab8c321b92cc7f3fa97a8a0a3
sipa commented at 11:52 AM on August 23, 2016: memberutACK 8680d3aa800aa4fab8c321b92cc7f3fa97a8a0a3
jonasschnelli commented at 8:31 AM on August 24, 2016: contributorlaanwj merged this on Aug 24, 2016laanwj closed this on Aug 24, 2016laanwj referenced this in commit f9167003d9 on Aug 24, 2016codablock referenced this in commit 5efc15dffe on Sep 19, 2017codablock referenced this in commit 52cbe60f94 on Jan 9, 2018codablock referenced this in commit d97fa0402f on Jan 9, 2018andvgal referenced this in commit e0aa5d802f on Jan 6, 2019DrahtBot locked this on Sep 8, 2021Labels
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:15 UTC
More mirrored repositories can be found on mirror.b10c.me