Meet code style on lines changed in the previous commit

pull/384/head
Matt Corallo 8 years ago
parent 4a3fc35629
commit 28301b9780

@ -3081,11 +3081,15 @@ bool CWallet::NewKeyPool()
{ {
LOCK(cs_wallet); LOCK(cs_wallet);
CWalletDB walletdb(*dbw); CWalletDB walletdb(*dbw);
for (int64_t nIndex : setInternalKeyPool)
for (int64_t nIndex : setInternalKeyPool) {
walletdb.ErasePool(nIndex); walletdb.ErasePool(nIndex);
}
setInternalKeyPool.clear(); setInternalKeyPool.clear();
BOOST_FOREACH(int64_t nIndex, setExternalKeyPool)
for (int64_t nIndex : setExternalKeyPool) {
walletdb.ErasePool(nIndex); walletdb.ErasePool(nIndex);
}
setExternalKeyPool.clear(); setExternalKeyPool.clear();
if (!TopUpKeyPool()) { if (!TopUpKeyPool()) {
@ -3132,12 +3136,16 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
for (int64_t i = missingInternal + missingExternal; i--;) for (int64_t i = missingInternal + missingExternal; i--;)
{ {
int64_t nEnd = 1; int64_t nEnd = 1;
if (i < missingInternal) if (i < missingInternal) {
internal = true; internal = true;
if (!setInternalKeyPool.empty()) }
if (!setInternalKeyPool.empty()) {
nEnd = *(--setInternalKeyPool.end()) + 1; nEnd = *(--setInternalKeyPool.end()) + 1;
if (!setExternalKeyPool.empty()) }
if (!setExternalKeyPool.empty()) {
nEnd = std::max(nEnd, *(--setExternalKeyPool.end()) + 1); nEnd = std::max(nEnd, *(--setExternalKeyPool.end()) + 1);
}
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey(internal), internal))) if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey(internal), internal)))
throw std::runtime_error(std::string(__func__) + ": writing generated key failed"); throw std::runtime_error(std::string(__func__) + ": writing generated key failed");
@ -3238,8 +3246,9 @@ static int64_t GetOldestKeyTimeInPool(const std::set<int64_t>& setKeyPool, CWall
CKeyPool keypool; CKeyPool keypool;
int64_t nIndex = *(setKeyPool.begin()); int64_t nIndex = *(setKeyPool.begin());
if (!walletdb.ReadPool(nIndex, keypool)) if (!walletdb.ReadPool(nIndex, keypool)) {
throw std::runtime_error(std::string(__func__) + ": read oldest key in keypool failed"); throw std::runtime_error(std::string(__func__) + ": read oldest key in keypool failed");
}
assert(keypool.vchPubKey.IsValid()); assert(keypool.vchPubKey.IsValid());
return keypool.nTime; return keypool.nTime;
} }
@ -3434,8 +3443,9 @@ void CReserveKey::KeepKey()
void CReserveKey::ReturnKey() void CReserveKey::ReturnKey()
{ {
if (nIndex != -1) if (nIndex != -1) {
pwallet->ReturnKey(nIndex, fInternal); pwallet->ReturnKey(nIndex, fInternal);
}
nIndex = -1; nIndex = -1;
vchPubKey = CPubKey(); vchPubKey = CPubKey();
} }

Loading…
Cancel
Save