On regtest, I can use generateblock
to successfully a mine transaction i.e containing an input with nSequence (0x05000000), although the input has not reached the specified age (5 confirmations). Though I get non-BIP68-final (code -26) error when I use sendrawtransaction
. Wondering why this is the case.
Here's how I do it:
For easy demonstration I fund OP_TRUE (decodescript 51
). It gives me p2wsh address: bcrt1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqseac85
.
Then I fund this address 1000 sats: TXID: a21c3ccc203f0c30c613e4409b011e5753ca10bb93fe5036849ab87e14e4cb6c
, VOUT: 1
.
Then I mine this funding transaction:
generateblock 2N1AwW2Jv4NcsgBWwggDPN7PLx4MpgRNjhs '["a21c3ccc203f0c30c613e4409b011e5753ca10bb93fe5036849ab87e14e4cb6c"]'
Then I manually construct a raw tx spending this input with witness 0x51, with nSequence 0x02000000:
020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000
sendrawtransaction 020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000
gives me the error: “non-BIP68-final (code -26)”
However,
generateblock 2N1AwW2Jv4NcsgBWwggDPN7PLx4MpgRNjhs '["020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000"]'
successfully mines the block:
{
"hash": "0f63ae01726730e186a5a8e16c2b4f9673ce135c46d033f8c60ee636319ffa6a"
}