Skip to content

Commit d40a72c

Browse files
committed
Clarify *(--.end()) iterator semantics in CWallet::TopUpKeyPool
1 parent 28301b9 commit d40a72c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,10 +3141,10 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
31413141
}
31423142

31433143
if (!setInternalKeyPool.empty()) {
3144-
nEnd = *(--setInternalKeyPool.end()) + 1;
3144+
nEnd = *(setInternalKeyPool.rbegin()) + 1;
31453145
}
31463146
if (!setExternalKeyPool.empty()) {
3147-
nEnd = std::max(nEnd, *(--setExternalKeyPool.end()) + 1);
3147+
nEnd = std::max(nEnd, *(setExternalKeyPool.rbegin()) + 1);
31483148
}
31493149

31503150
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey(internal), internal)))

0 commit comments

Comments
 (0)