mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 19:06:51 +00:00
This modifies the script engine to replace OP_NOP3 with OP_CHECKSEQUENCEVERIFY and adds a flag to selectively enable its enforcement. The new opcode examines the top item on the stack and compares it against the sequence number of the associated transaction input in order to allow scripts to conditionally enforce the inclusion of relative time locks to the transaction. The following is an overview of the changes: - Introduce a new flag named ScriptVerifyCheckSequenceVerify to provide conditional enforcement of the new opcode - Introduce a constant named OP_CHECKSEQUENCEVERIFY which has the same value as OP_NOP3 since it is replacing it - Update opcode to name mappings accordingly - Abstract the logic that deals with time lock verification since it is the same for both the new opcode and OP_CHECKLOCKTIMEVERIFY - Implement the required opcode semantics - Add tests to ensure the opcode works as expected including when used both correctly and incorrectly |
||
|---|---|---|
| .. | ||
| LICENSE | ||
| script_invalid.json | ||
| script_valid.json | ||
| tx_invalid.json | ||
| tx_valid.json | ||