When does the "reject" string have an empty reject reason upon submitting a new block?

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

Source.

Eleven

Posted 2014-12-13T08:38:40.023

Reputation: 187

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 2014-12-19T19:23:50.280

Does the source of CValidationState::GetRejectReason have anything useful?Nate Eldredge 2014-12-19T20:23:26.473

Which version of the source code? There have been recent changes in this area.Pieter Wuille 2014-12-19T21:11:30.250

No answers