3

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?";
}

Source.

| improve this question | | | | |
  • Are you using the command submit (which doesn't exist, I think) the command submitblock, or getblocktemplate with the mode argument set to proposal? – Nick ODell Dec 19 '14 at 19:23
  • Does the source of CValidationState::GetRejectReason have anything useful? – Nate Eldredge Dec 19 '14 at 20:23
  • Which version of the source code? There have been recent changes in this area. – Pieter Wuille Dec 19 '14 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.