From 5cb3da04b8882ca975b4e3d6c089c64bbaf67d0d Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Sun, 23 Jul 2017 23:32:57 +0200 Subject: 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. --- src/wallet/wallet.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/wallet/wallet.cpp') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 223790aa4..fcb679e75 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3660,13 +3660,10 @@ void CWallet::GetKeyBirthTimes(std::map &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 mapKeyFirstBlock; - std::set 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()) -- cgit v1.2.3