3
1
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?";
}
Are you using the command
submit(which doesn't exist, I think) the commandsubmitblock, orgetblocktemplatewith the mode argument set toproposal? – Nick ODell – 2014-12-19T19:23:50.280Does the source of
CValidationState::GetRejectReasonhave anything useful? – Nate Eldredge – 2014-12-19T20:23:26.473Which version of the source code? There have been recent changes in this area. – Pieter Wuille – 2014-12-19T21:11:30.250