From fa6ab8ada14dd265e224496440ab0b5d99dfd0ef Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 15 Aug 2018 13:54:36 -0400 Subject: rpc: Return more specific reject reason for submitblock --- src/rpc/mining.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/rpc/mining.cpp') diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 623b0bd86a..8365f5ed42 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -750,11 +750,7 @@ static UniValue submitblock(const JSONRPCRequest& request) RegisterValidationInterface(&sc); bool accepted = ProcessNewBlock(Params(), blockptr, /* fForceProcessing */ true, /* fNewBlock */ &new_block); UnregisterValidationInterface(&sc); - if (!new_block) { - if (!accepted) { - // TODO Maybe pass down fNewBlock to AcceptBlockHeader, so it is properly set to true in this case? - return "invalid"; - } + if (!new_block && accepted) { return "duplicate"; } if (!sc.found) { -- cgit v1.2.3