Merge pull request #1323 from MyHush/snapshot_fix

Filter out amount=0 UTXOs from getsnapshot results
This commit is contained in:
jl777
2019-03-09 16:01:18 -11:00
committed by GitHub

View File

@@ -491,6 +491,7 @@ UniValue CBlockTreeDB::Snapshot(int top)
getAddressFromIndex(indexKey.type, indexKey.hashBytes, address); getAddressFromIndex(indexKey.type, indexKey.hashBytes, address);
if (nValue > 0) {
std::map <std::string, int>::iterator ignored = ignoredMap.find(address); std::map <std::string, int>::iterator ignored = ignoredMap.find(address);
if (ignored != ignoredMap.end()) { if (ignored != ignoredMap.end()) {
fprintf(stderr,"ignoring %s\n", address.c_str()); fprintf(stderr,"ignoring %s\n", address.c_str());
@@ -512,6 +513,9 @@ UniValue CBlockTreeDB::Snapshot(int top)
//fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN); //fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN);
// total += nValue; // total += nValue;
utxos++; utxos++;
} else {
fprintf(stderr,"ignoring amount=0 UTXO for %s\n", address.c_str());
}
} catch (const std::exception& e) { } catch (const std::exception& e) {
fprintf(stderr, "DONE %s: LevelDB addressindex exception! - %s\n", __func__, e.what()); fprintf(stderr, "DONE %s: LevelDB addressindex exception! - %s\n", __func__, e.what());
break; break;