This commit is contained in:
blackjok3r
2019-05-04 01:55:33 +08:00
parent aa32b1f963
commit 9802d350aa
2 changed files with 5 additions and 3 deletions

View File

@@ -481,6 +481,8 @@ bool CBlockTreeDB::Snapshot2(std::map <std::string, CAmount> &addressAmounts, Un
try {
CAmount nValue;
iter->GetValue(nValue);
if ( nValue == 0 )
continue;
getAddressFromIndex(indexKey.type, indexKey.hashBytes, address);
if ( indexKey.type == 3 )
{
@@ -566,9 +568,9 @@ UniValue CBlockTreeDB::Snapshot(int top)
UniValue result(UniValue::VOBJ);
UniValue addressesSorted(UniValue::VARR);
result.push_back(Pair("start_time", (int) time(NULL)));
if ( (vAddressSnapshot.size() > 0 && top < 0) || (Snapshot2(addressAmounts,&result) && top > 0) )
if ( (vAddressSnapshot.size() > 0 && top < 0) || (Snapshot2(addressAmounts,&result) && top >= 0) )
{
if ( top > 0 )
if ( top > -1 )
{
for (std::pair<std::string, CAmount> element : addressAmounts)
vaddr.push_back( make_pair(element.second, element.first) );