4

I know that non-final transactions (locktime in future and sequence number < MAX_UINT) are not "accepted by miners". However, I could not figure out the exact behavior.

If I mined my own block with a non-final transaction, would that block be considered valid, i.e., would clients add it to their copy of the chain and would other miners build on top of that block? (I suppose the answer is "no" because otherwise attacks on contracts could be possible.)

  • This may be possible, assuming that other miners will accept your block and not orphan it. However, you still need to sign the inputs of the transaction with the appropriate keys, so I'm not sure why you think that would allow an attack on a contract. – rdb Feb 17 '14 at 20:40
4

No. In the reference client, main.cpp runs this check during "AcceptBlock":

    // Check that all transactions are finalized
    BOOST_FOREACH(const CTransaction& tx, block.vtx)
        if (!IsFinalTx(tx, nHeight, block.GetBlockTime()))
            return state.DoS(10, error("AcceptBlock() : contains a non-final transaction"),
                             REJECT_INVALID, "bad-txns-nonfinal");

which rejects your block if it contain a non-final transaction. A client that accepts a block containing a transaction with a locktime in the future and sequence number less than std::numeric_limits<unsigned int>::max() would be on the losing side of a fork.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.