Browse Source

Clarify *(--.end()) iterator semantics in CWallet::TopUpKeyPool

0.15
Matt Corallo 8 years ago
parent
commit
d40a72ccbb
  1. 4
      src/wallet/wallet.cpp

4
src/wallet/wallet.cpp

@ -3141,10 +3141,10 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize) @@ -3141,10 +3141,10 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
}
if (!setInternalKeyPool.empty()) {
nEnd = *(--setInternalKeyPool.end()) + 1;
nEnd = *(setInternalKeyPool.rbegin()) + 1;
}
if (!setExternalKeyPool.empty()) {
nEnd = std::max(nEnd, *(--setExternalKeyPool.end()) + 1);
nEnd = std::max(nEnd, *(setExternalKeyPool.rbegin()) + 1);
}
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey(internal), internal)))

Loading…
Cancel
Save