Add CPrivateSendClientOptions::GetJsonInfo()

This commit is contained in:
UdjinM6 2020-07-17 02:30:00 +03:00 committed by pasta
parent 4ac00e5589
commit 50b09b88e4
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
3 changed files with 17 additions and 8 deletions

View File

@ -1843,6 +1843,18 @@ void CPrivateSendClientManager::GetJsonInfo(UniValue& obj) const
obj.pushKV("sessions", arrSessions);
}
void CPrivateSendClientOptions::GetJsonInfo(UniValue& obj) const
{
assert(obj.isObject());
obj.pushKV("enabled", privateSendClientOptions.fEnablePrivateSend);
obj.pushKV("multisession", privateSendClientOptions.fPrivateSendMultiSession);
obj.pushKV("max_sessions", privateSendClientOptions.nPrivateSendSessions);
obj.pushKV("max_rounds", privateSendClientOptions.nPrivateSendRounds);
obj.pushKV("max_amount", privateSendClientOptions.nPrivateSendAmount);
obj.pushKV("denoms_goal", privateSendClientOptions.nPrivateSendDenomsGoal);
obj.pushKV("denoms_hardcap", privateSendClientOptions.nPrivateSendDenomsHardCap);
}
void DoPrivateSendMaintenance(CConnman& connman)
{
privateSendClientQueueManager.DoMaintenance();

View File

@ -298,6 +298,8 @@ public:
fPrivateSendMultiSession(DEFAULT_PRIVATESEND_MULTISESSION)
{
}
void GetJsonInfo(UniValue& obj) const;
};
void DoPrivateSendMaintenance(CConnman& connman);

View File

@ -136,14 +136,9 @@ UniValue getprivatesendinfo(const JSONRPCRequest& request)
#ifdef ENABLE_WALLET
obj.pushKV("enabled", privateSendClientOptions.fEnablePrivateSend);
obj.pushKV("multisession", privateSendClientOptions.fPrivateSendMultiSession);
obj.pushKV("max_sessions", privateSendClientOptions.nPrivateSendSessions);
obj.pushKV("max_rounds", privateSendClientOptions.nPrivateSendRounds);
obj.pushKV("max_amount", privateSendClientOptions.nPrivateSendAmount);
obj.pushKV("denoms_goal", privateSendClientOptions.nPrivateSendDenomsGoal);
obj.pushKV("denoms_hardcap", privateSendClientOptions.nPrivateSendDenomsHardCap);
obj.pushKV("queue_size", privateSendClientQueueManager.GetQueueSize());
privateSendClientOptions.GetJsonInfo(obj);
obj.pushKV("queue_size", privateSendClientQueueManager.GetQueueSize());
CWallet* const pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) {