Skip to content

Commit

Permalink
prep for point release
Browse files Browse the repository at this point in the history
Former-commit-id: 4113537
  • Loading branch information
sidhujag committed Jun 3, 2019
1 parent 66a0262 commit ad63269
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@

#include <mutex>
#include <condition_variable>
// SYSCOIN snapshot
#include <ostream>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
#include "script/standard.h"
#include "base58.h"
namespace io = boost::iostreams;

struct CUpdatedBlock
{
uint256 hash;
Expand Down Expand Up @@ -964,12 +958,6 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash,
//! Calculate statistics about the unspent transaction output set
static bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats)
{
// SYSCOIN snapshot code
CTxDestination address;
io::stream_buffer<io::file_sink> buf("utxo.json");
std::ostream ta(&buf);
ta << "[";
std::map<std::string, CAmount> mapAddressToAmount;
std::unique_ptr<CCoinsViewCursor> pcursor(view->Cursor());

CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
Expand All @@ -991,11 +979,6 @@ static bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats)
outputs.clear();
}
prevkey = key.hash;
// SYSCOIN snapshot
if (ExtractDestination(coin.out.scriptPubKey, address))
mapAddressToAmount[CSyscoinAddress(address).ToString()] += coin.out.nValue;
else
LogPrintf("Could not extract address for pubkey %s\n", HexStr(coin.out.scriptPubKey).c_str());
outputs[key.n] = std::move(coin);
} else {
return error("%s: unable to read value", __func__);
Expand All @@ -1007,15 +990,6 @@ static bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats)
}
stats.hashSerialized = ss.GetHash();
stats.nDiskSize = view->EstimateSize();
// SYSCOIN snapshot
for (auto iter = mapAddressToAmount.begin(); iter != mapAddressToAmount.end(); ) {
ta << "[\"" << iter->first << "\"," << iter->second;
if (++iter != mapAddressToAmount.end())
ta << "]," << std::endl;
else
ta << "]" << std::endl;
}
ta << "]";
return true;
}

Expand Down Expand Up @@ -1758,4 +1732,4 @@ void RegisterBlockchainRPCCommands(CRPCTable &t)
{
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
t.appendCommand(commands[vcidx].name, &commands[vcidx]);
}
}

0 comments on commit ad63269

Please sign in to comment.