Skip to content

Commit e69a587

Browse files
committed
RPC: submitblock: Support for returning specific rejection reasons
1 parent 1bea2bb commit e69a587

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rpcmining.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,12 @@ Value submitblock(const Array& params, bool fHelp)
592592
throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
593593
}
594594
if (state.IsInvalid())
595-
return "rejected"; // TODO: report validation state
595+
{
596+
std::string strRejectReason = state.GetRejectReason();
597+
if (strRejectReason.empty())
598+
return "rejected";
599+
return strRejectReason;
600+
}
596601

597602
return Value::null;
598603
}

0 commit comments

Comments
 (0)