Merge pull request #3727

e69a587 RPC: submitblock: Support for returning specific rejection reasons (Luke Dashjr)
This commit is contained in:
Wladimir J. van der Laan 2014-11-03 20:47:25 +01:00
commit ff17816abf
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -593,7 +593,12 @@ Value submitblock(const Array& params, bool fHelp)
throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
}
if (state.IsInvalid())
return "rejected"; // TODO: report validation state
{
std::string strRejectReason = state.GetRejectReason();
if (strRejectReason.empty())
return "rejected";
return strRejectReason;
}
return Value::null;
}