Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,10 @@ BITCOIN_CORE_H = \
rpc/client.h \
rpc/mining.h \
rpc/protocol.h \
rpc/server.h \
rpc/rawtransaction_util.h \
rpc/register.h \
rpc/request.h \
rpc/server.h \
rpc/util.h \
saltedhasher.h \
scheduler.h \
Expand Down Expand Up @@ -292,6 +293,7 @@ BITCOIN_CORE_H = \
unordered_lru_cache.h \
util/bip32.h \
util/bytevectorhash.h \
util/check.h \
util/error.h \
util/fees.h \
util/spanparsing.h \
Expand Down Expand Up @@ -678,7 +680,7 @@ libdash_util_a_SOURCES = \
interfaces/handler.cpp \
logging.cpp \
random.cpp \
rpc/protocol.cpp \
rpc/request.cpp \
stacktraces.cpp \
support/cleanse.cpp \
sync.cpp \
Expand Down
1 change: 1 addition & 0 deletions src/dash-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <clientversion.h>
#include <rpc/client.h>
#include <rpc/protocol.h>
#include <rpc/request.h>
#include <stacktraces.h>
#include <util/system.h>
#include <util/strencodings.h>
Expand Down
1 change: 1 addition & 0 deletions src/rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <rpc/blockchain.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <streams.h>
#include <sync.h>
Expand Down
306 changes: 150 additions & 156 deletions src/rpc/blockchain.cpp

Large diffs are not rendered by default.

53 changes: 26 additions & 27 deletions src/rpc/coinjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
#ifdef ENABLE_WALLET
static UniValue coinjoin(const JSONRPCRequest& request)
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
CWallet* const pwallet = wallet.get();
if (!EnsureWalletIsAvailable(pwallet, request.fHelp))
return NullUniValue;

if (request.fHelp || request.params.size() != 1)
throw std::runtime_error(
RPCHelpMan{"coinjoin",
Expand All @@ -37,6 +32,10 @@ static UniValue coinjoin(const JSONRPCRequest& request)
RPCExamples{""},
}.ToString());

std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get();

if (fMasternodeMode)
throw JSONRPCError(RPC_INTERNAL_ERROR, "Client-side mixing is not supported on masternodes");

Expand Down Expand Up @@ -103,36 +102,36 @@ static UniValue getcoinjoininfo(const JSONRPCRequest& request)
RPCResults{
{"for regular nodes",
"{\n"
" \"enabled\": true|false, (bool) Whether mixing functionality is enabled\n"
" \"multisession\": true|false, (bool) Whether CoinJoin Multisession option is enabled\n"
" \"max_sessions\": xxx, (numeric) How many parallel mixing sessions can there be at once\n"
" \"max_rounds\": xxx, (numeric) How many rounds to mix\n"
" \"max_amount\": xxx, (numeric) Target CoinJoin balance in " + CURRENCY_UNIT + "\n"
" \"denoms_goal\": xxx, (numeric) How many inputs of each denominated amount to target\n"
" \"denoms_hardcap\": xxx, (numeric) Maximum limit of how many inputs of each denominated amount to create\n"
" \"queue_size\": xxx, (numeric) How many queues there are currently on the network\n"
" \"running\": true|false, (bool) Whether mixing is currently running\n"
" \"sessions\": (array of json objects)\n"
" \"enabled\" : true|false, (boolean) Whether mixing functionality is enabled\n"
" \"multisession\" : true|false, (boolean) Whether CoinJoin Multisession option is enabled\n"
" \"max_sessions\" : xxx, (numeric) How many parallel mixing sessions can there be at once\n"
" \"max_rounds\" : xxx, (numeric) How many rounds to mix\n"
" \"max_amount\" : xxx, (numeric) Target CoinJoin balance in " + CURRENCY_UNIT + "\n"
" \"denoms_goal\" : xxx, (numeric) How many inputs of each denominated amount to target\n"
" \"denoms_hardcap\" : xxx, (numeric) Maximum limit of how many inputs of each denominated amount to create\n"
" \"queue_size\" : xxx, (numeric) How many queues there are currently on the network\n"
" \"running\" : true|false, (boolean) Whether mixing is currently running\n"
" \"sessions\" : (array of json objects)\n"
" [\n"
" {\n"
" \"protxhash\": \"...\", (string) The ProTxHash of the masternode\n"
" \"outpoint\": \"txid-index\", (string) The outpoint of the masternode\n"
" \"service\": \"host:port\", (string) The IP address and port of the masternode\n"
" \"denomination\": xxx, (numeric) The denomination of the mixing session in " + CURRENCY_UNIT + "\n"
" \"state\": \"...\", (string) Current state of the mixing session\n"
" \"entries_count\": xxx, (numeric) The number of entries in the mixing session\n"
" \"protxhash\" : \"...\", (string) The ProTxHash of the masternode\n"
" \"outpoint\" : \"txid-index\", (string) The outpoint of the masternode\n"
" \"service\" : \"host:port\", (string) The IP address and port of the masternode\n"
" \"denomination\" : xxx, (numeric) The denomination of the mixing session in " + CURRENCY_UNIT + "\n"
" \"state\" : \"...\", (string) Current state of the mixing session\n"
" \"entries_count\" : xxx, (numeric) The number of entries in the mixing session\n"
" }\n"
" ,...\n"
" ],\n"
" \"keys_left\": xxx, (numeric) How many new keys are left since last automatic backup\n"
" \"warnings\": \"...\" (string) Warnings if any\n"
" \"keys_left\" : xxx, (numeric) How many new keys are left since last automatic backup\n"
" \"warnings\" : \"...\" (string) Warnings if any\n"
"}\n"
}, {"for masternodes",
"{\n"
" \"queue_size\": xxx, (numeric) How many queues there are currently on the network\n"
" \"denomination\": xxx, (numeric) The denomination of the mixing session in " + CURRENCY_UNIT + "\n"
" \"state\": \"...\", (string) Current state of the mixing session\n"
" \"entries_count\": xxx, (numeric) The number of entries in the mixing session\n"
" \"queue_size\" : xxx, (numeric) How many queues there are currently on the network\n"
" \"denomination\" : xxx, (numeric) The denomination of the mixing session in " + CURRENCY_UNIT + "\n"
" \"state\" : \"...\", (string) Current state of the mixing session\n"
" \"entries_count\" : xxx, (numeric) The number of entries in the mixing session\n"
"}\n"
}},
RPCExamples{
Expand Down
Loading