diff --git a/src/txdb.cpp b/src/txdb.cpp index 1c5bc6fb42..ff5e450d07 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -322,12 +322,9 @@ size_t CBlockTreeDB::findAddressNumWBalance() { std::pair key; if (pcursor->GetKey(key) && key.first == DB_ADDRESSINDEX && (key.second.type == AddressType::payToPubKeyHash || key.second.type == AddressType::payToExchangeAddress)) { CAmount nValue; - if (pcursor->GetValue(nValue)) { - CAmount nValue; - // Retrieve the associated value - if (pcursor->GetValue(nValue) && nValue != 0) { // Only process non-zero values - addrMap[key.second.hashBytes] += nValue; // Accumulate balance for the address - } + // Retrieve the associated value + if (pcursor->GetValue(nValue) && nValue != 0) { // Only process non-zero values + addrMap[key.second.hashBytes] += nValue; // Accumulate balance for the address } } pcursor->Next();