mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
rpc: disallow coinjoin stop
if there's no CoinJoin session to stop
This commit is contained in:
parent
51b6b94fc0
commit
89ade3e340
4
doc/release-notes-6107.md
Normal file
4
doc/release-notes-6107.md
Normal file
@ -0,0 +1,4 @@
|
||||
RPC changes
|
||||
-----------
|
||||
|
||||
- `coinjoin stop` will now return an error if there is no CoinJoin mixing session to stop
|
@ -172,6 +172,9 @@ static RPCHelpMan coinjoin_stop()
|
||||
auto cj_clientman = node.coinjoin_loader->walletman().Get(wallet->GetName());
|
||||
|
||||
CHECK_NONFATAL(cj_clientman);
|
||||
if (!cj_clientman->IsMixing()) {
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "No mix session to stop");
|
||||
}
|
||||
cj_clientman->StopMixing();
|
||||
|
||||
return "Mixing was stopped";
|
||||
|
Loading…
Reference in New Issue
Block a user