Better use copies on iterate claim and support re-add

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
This commit is contained in:
Anthony Fieroni 2019-07-16 21:26:28 +03:00 committed by Brannon King
parent c02b04f120
commit e5c8b6b8ff

View file

@ -166,7 +166,7 @@ bool CClaimTrieCacheNormalizationFork::normalizeAllNamesInTrieIfNecessary(insert
continue;
auto supports = getSupportsForName(it.key());
for (auto& support : supports) {
for (auto support : supports) {
// if it's already going to expire just skip it
if (support.nHeight + expirationTime() <= nNextHeight)
continue;
@ -183,7 +183,7 @@ bool CClaimTrieCacheNormalizationFork::normalizeAllNamesInTrieIfNecessary(insert
if (!cached || cached->empty())
continue;
for (auto& claim : it->claims) {
for (auto claim : it->claims) {
if (claim.nHeight + expirationTime() <= nNextHeight)
continue;