rpc: Return more specific reject reason for submitblock

This commit is contained in:
MarcoFalke 2018-08-15 13:54:36 -04:00
parent b5591ca0b0
commit fa6ab8ada1
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
2 changed files with 20 additions and 7 deletions

View file

@ -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) {