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:
Marko Bencun
2017-07-23 23:32:57 +02:00
parent 0c173a15ca
commit 5cb3da04b8
3 changed files with 19 additions and 29 deletions

View File

@@ -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())