Skip to content

Commit ff17816

Browse files
committed
Merge pull request #3727
e69a587 RPC: submitblock: Support for returning specific rejection reasons (Luke Dashjr)
2 parents 7f7fede + e69a587 commit ff17816

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
@@ -593,7 +593,12 @@ Value submitblock(const Array& params, bool fHelp)
593593
throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
594594
}
595595
if (state.IsInvalid())
596-
return "rejected"; // TODO: report validation state
596+
{
597+
std::string strRejectReason = state.GetRejectReason();
598+
if (strRejectReason.empty())
599+
return "rejected";
600+
return strRejectReason;
601+
}
597602

598603
return Value::null;
599604
}

0 commit comments

Comments
 (0)