mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
rpc: Return more specific reject reason for submitblock
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user