Skip to content

Commit

Permalink
rpc: disallow coinjoin stop if there's no CoinJoin session to stop
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Jul 11, 2024
1 parent 51b6b94 commit 89ade3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/release-notes-6107.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RPC changes
-----------

- `coinjoin stop` will now return an error if there is no CoinJoin mixing session to stop
3 changes: 3 additions & 0 deletions src/rpc/coinjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 89ade3e

Please sign in to comment.