aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-08-12 19:01:04 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-08-12 19:29:14 +0200
commit13c4635a3ecfbc6759301fb3c94bd5293c49388c (patch)
treec49e3eaaad76a4f9048f2b75b6b521f2acf7ed8e /src
parentbd00d3b1f2036893419d1e8c514a8af2c4e4b1fb (diff)
parenta51d0ad2de89b9757d158df95ddeba2bfcb23935 (diff)
Merge #19696: rpc: Fix addnode remove command error
a51d0ad2de89b9757d158df95ddeba2bfcb23935 rpc: Improve addnode remove command error message (Fabian Jahr) Pull request description: The `addnode` RPC with the `remove` command parameter is used to remove a node from the "added nodes". It did not have test coverage and in case of failure to remove the node it responded with the confusing message "Error: Node has not been added.". This PR adds test coverage and introduces a new error code as well as changes the error message to something that makes sense. ACKs for top commit: laanwj: Code review ACK a51d0ad2de89b9757d158df95ddeba2bfcb23935 theStack: Tested ACK https://github.com/bitcoin/bitcoin/commit/a51d0ad2de Tree-SHA512: 033ef5de0d4d49d58ef4df3759b838c9d19ee9dfb0aff9f814a3a63d124ca231a442c930efa7d343fe1f65727c4b59fc23dd5e26fe6ea69f9e84fda48b5c5cc2
Diffstat (limited to 'src')
-rw-r--r--src/rpc/net.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index 0dfd560896..77d24a6e79 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -276,7 +276,7 @@ static UniValue addnode(const JSONRPCRequest& request)
else if(strCommand == "remove")
{
if(!node.connman->RemoveAddedNode(strNode))
- throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, "Error: Node has not been added.");
+ throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, "Error: Node could not be removed. It has not been added previously.");
}
return NullUniValue;