mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
rpc: Return more specific reject reason for submitblock
This commit is contained in:
parent
b5591ca0b0
commit
fa6ab8ada1
2 changed files with 20 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue