I submitted a new block using the rpc command submit
. And I just got a "reject" string without a reject reason.
I checked the bitcoind source code, and found that it usually sends a reject reason; bitcoind would only omit a reason if the strRejectReason
is empty. Why and when would the strRejectReason
be empty?
static Value BIP22ValidationResult(const CValidationState& state)
{
if (state.IsValid())
return Value::null;
std::string strRejectReason = state.GetRejectReason();
if (state.IsError())
throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
if (state.IsInvalid())
{
if (strRejectReason.empty())
return "rejected"; // The value that gets returned
return strRejectReason;
}
// Should be impossible
return "valid?";
}
submit
(which doesn't exist, I think) the commandsubmitblock
, orgetblocktemplate
with the mode argument set toproposal
? – Nick ODell Dec 19 '14 at 19:23CValidationState::GetRejectReason
have anything useful? – Nate Eldredge Dec 19 '14 at 20:23