|
|
@ -781,11 +781,12 @@ struct CCoinsStats |
|
|
|
uint256 hashBlock; |
|
|
|
uint256 hashBlock; |
|
|
|
uint64_t nTransactions; |
|
|
|
uint64_t nTransactions; |
|
|
|
uint64_t nTransactionOutputs; |
|
|
|
uint64_t nTransactionOutputs; |
|
|
|
|
|
|
|
uint64_t nBogoSize; |
|
|
|
uint256 hashSerialized; |
|
|
|
uint256 hashSerialized; |
|
|
|
uint64_t nDiskSize; |
|
|
|
uint64_t nDiskSize; |
|
|
|
CAmount nTotalAmount; |
|
|
|
CAmount nTotalAmount; |
|
|
|
|
|
|
|
|
|
|
|
CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nTotalAmount(0) {} |
|
|
|
CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nBogoSize(0), nDiskSize(0), nTotalAmount(0) {} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, const std::map<uint32_t, Coin>& outputs) |
|
|
|
static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, const std::map<uint32_t, Coin>& outputs) |
|
|
@ -800,6 +801,8 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, |
|
|
|
ss << VARINT(output.second.out.nValue); |
|
|
|
ss << VARINT(output.second.out.nValue); |
|
|
|
stats.nTransactionOutputs++; |
|
|
|
stats.nTransactionOutputs++; |
|
|
|
stats.nTotalAmount += output.second.out.nValue; |
|
|
|
stats.nTotalAmount += output.second.out.nValue; |
|
|
|
|
|
|
|
stats.nBogoSize += 32 /* txid */ + 4 /* vout index */ + 4 /* height + coinbase */ + 8 /* amount */ + |
|
|
|
|
|
|
|
2 /* scriptPubKey len */ + output.second.out.scriptPubKey.size() /* scriptPubKey */; |
|
|
|
} |
|
|
|
} |
|
|
|
ss << VARINT(0); |
|
|
|
ss << VARINT(0); |
|
|
|
} |
|
|
|
} |
|
|
@ -904,7 +907,8 @@ UniValue gettxoutsetinfo(const JSONRPCRequest& request) |
|
|
|
" \"bestblock\": \"hex\", (string) the best block hash hex\n" |
|
|
|
" \"bestblock\": \"hex\", (string) the best block hash hex\n" |
|
|
|
" \"transactions\": n, (numeric) The number of transactions\n" |
|
|
|
" \"transactions\": n, (numeric) The number of transactions\n" |
|
|
|
" \"txouts\": n, (numeric) The number of output transactions\n" |
|
|
|
" \"txouts\": n, (numeric) The number of output transactions\n" |
|
|
|
" \"hash_serialized\": \"hash\", (string) The serialized hash\n" |
|
|
|
" \"bogosize\": n, (numeric) A meaningless metric for UTXO set size\n" |
|
|
|
|
|
|
|
" \"hash_serialized_2\": \"hash\", (string) The serialized hash\n" |
|
|
|
" \"disk_size\": n, (numeric) The estimated size of the chainstate on disk\n" |
|
|
|
" \"disk_size\": n, (numeric) The estimated size of the chainstate on disk\n" |
|
|
|
" \"total_amount\": x.xxx (numeric) The total amount\n" |
|
|
|
" \"total_amount\": x.xxx (numeric) The total amount\n" |
|
|
|
"}\n" |
|
|
|
"}\n" |
|
|
@ -922,6 +926,7 @@ UniValue gettxoutsetinfo(const JSONRPCRequest& request) |
|
|
|
ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); |
|
|
|
ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); |
|
|
|
ret.push_back(Pair("transactions", (int64_t)stats.nTransactions)); |
|
|
|
ret.push_back(Pair("transactions", (int64_t)stats.nTransactions)); |
|
|
|
ret.push_back(Pair("txouts", (int64_t)stats.nTransactionOutputs)); |
|
|
|
ret.push_back(Pair("txouts", (int64_t)stats.nTransactionOutputs)); |
|
|
|
|
|
|
|
ret.push_back(Pair("bogosize", (int64_t)stats.nBogoSize)); |
|
|
|
ret.push_back(Pair("hash_serialized_2", stats.hashSerialized.GetHex())); |
|
|
|
ret.push_back(Pair("hash_serialized_2", stats.hashSerialized.GetHex())); |
|
|
|
ret.push_back(Pair("disk_size", stats.nDiskSize)); |
|
|
|
ret.push_back(Pair("disk_size", stats.nDiskSize)); |
|
|
|
ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount))); |
|
|
|
ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount))); |
|
|
|