Track shielded spends on disk so we can calculate anonset in real-time correctly

This commit is contained in:
Duke Leto
2020-07-11 11:11:14 -04:00
parent d516a21d54
commit 40f0745fab
6 changed files with 22 additions and 7 deletions

View File

@@ -2003,8 +2003,9 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp, const CPubKey& mypk
ret.pushKV("shielding_payments", (int64_t)pindex->nChainShieldingPayments);
int64_t nullifierCount = pwalletMain->NullifierCount();
//TODO: this is unreliable, is only a cache or subset of total nullifiers
ret.pushKV("nullifiers", (int64_t)nullifierCount);
ret.pushKV("shielded_pool_size", (int64_t)pindex->nChainShieldedOutputs - nullifierCount);
ret.pushKV("shielded_pool_size", (int64_t)(pindex->nChainShieldedOutputs - pindex->nChainShieldedSpends));
ret.pushKV("shielded_outputs", (int64_t)pindex->nChainShieldedOutputs);
}