From 5e26d8ec4cf7ef763c80300dbc6121d910cc6bac Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 27 Aug 2019 04:42:24 -0700 Subject: [PATCH] WIP organic txstats and add some missing stats --- src/rpc/blockchain.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index ecc5cd848..122c6ba25 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2037,6 +2037,8 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp) if (fZindex) { ret.pushKV("notarization_txrate", ((double)nNotarizationsDiff) / nTimeDiff); ret.pushKV("shielded_txrate", ((double)nShieldedTxDiff) / nTimeDiff); + ret.pushKV("shielding_txrate", ((double)nShieldingTxDiff) / nTimeDiff); + ret.pushKV("deshielding_txrate", ((double)nDeshieldingTxDiff) / nTimeDiff); ret.pushKV("fully_shielded_txrate", ((double)nFullyShieldedTxDiff) / nTimeDiff); ret.pushKV("paymentrate", ((double)nPaymentsDiff) / nTimeDiff); ret.pushKV("shielded_paymentrate", ((double)nShieldedPaymentsDiff) / nTimeDiff); @@ -2078,6 +2080,17 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp) } if(nShieldedTxDiff+nShieldedPaymentsDiff > 0) ret.pushKV("shielded_only", shielded); + + // Organic tx stats = Raw - Coinbase - DPoW + UniValue organic(UniValue::VOBJ); + organic.pushKV("shielded_txrate", ((double)nShieldedTxDiff - blockcount - nNotarizationsDiff ) / nTimeDiff); + organic.pushKV("fully_shielded_txrate", ((double)nFullyShieldedTxDiff - blockcount - nNotarizationsDiff ) / nTimeDiff); + organic.pushKV("shielding_txrate", ((double)nShieldingTxDiff - blockcount - nNotarizationsDiff ) / nTimeDiff); + organic.pushKV("deshielding_txrate", ((double)nDeshieldingTxDiff - blockcount - nNotarizationsDiff ) / nTimeDiff); + + if (nTxDiff > 0) { + ret.pushKV("organic", organic); + } } }