diff --git a/doc/release-notes-6107.md b/doc/release-notes-6107.md new file mode 100644 index 0000000000..d8299b2ee4 --- /dev/null +++ b/doc/release-notes-6107.md @@ -0,0 +1,4 @@ +RPC changes +----------- + +- `coinjoin stop` will now return an error if there is no CoinJoin mixing session to stop diff --git a/src/rpc/coinjoin.cpp b/src/rpc/coinjoin.cpp index 1e239edd5f..29cf8fbb41 100644 --- a/src/rpc/coinjoin.cpp +++ b/src/rpc/coinjoin.cpp @@ -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";