mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-31 19:06:10 +02:00
keystore GetKeys(): return result instead of writing to reference
Issue: #10905 By returning the result, a few useless lines can be removed. Return-value-optimization means there should be no copy.
This commit is contained in:
@@ -3660,13 +3660,10 @@ void CWallet::GetKeyBirthTimes(std::map<CTxDestination, int64_t> &mapKeyBirth) c
|
||||
// map in which we'll infer heights of other keys
|
||||
CBlockIndex *pindexMax = chainActive[std::max(0, chainActive.Height() - 144)]; // the tip can be reorganized; use a 144-block safety margin
|
||||
std::map<CKeyID, CBlockIndex*> mapKeyFirstBlock;
|
||||
std::set<CKeyID> setKeys;
|
||||
GetKeys(setKeys);
|
||||
for (const CKeyID &keyid : setKeys) {
|
||||
for (const CKeyID &keyid : GetKeys()) {
|
||||
if (mapKeyBirth.count(keyid) == 0)
|
||||
mapKeyFirstBlock[keyid] = pindexMax;
|
||||
}
|
||||
setKeys.clear();
|
||||
|
||||
// if there are no such keys, we're done
|
||||
if (mapKeyFirstBlock.empty())
|
||||
|
||||
Reference in New Issue
Block a user