Update 9_2_Using_CLTV_in_Scripts.md

This commit is contained in:
Shannon Appelcline 2017-06-01 11:56:28 -07:00 committed by GitHub
parent d39995e424
commit 95ecd5c449

View File

@ -121,11 +121,13 @@ Stack: [ <signature> <pubKey> <NextYear> ]
Then, `OP_CHECKLOCKTIMEVERIFY` runs. It finds something on the stack and verifies that `nSequence` isn't 0xffffffff. Finally, it compares `<NextYear>` with `nLockTime`. If they are both the same sort of representation and if `nLockTime ≥ <NextYear>`, then it successfully processes (else, it ends the script): Then, `OP_CHECKLOCKTIMEVERIFY` runs. It finds something on the stack and verifies that `nSequence` isn't 0xffffffff. Finally, it compares `<NextYear>` with `nLockTime`. If they are both the same sort of representation and if `nLockTime ≥ <NextYear>`, then it successfully processes (else, it ends the script):
``` ```
Script: OP_DROP OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG Script: OP_DROP OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
Running: <NextYear> OP_CHECKLOCKTIMEVERIFY
Stack: [ <signature> <pubKey> <NextYear> ] Stack: [ <signature> <pubKey> <NextYear> ]
``` ```
Then, `OP_DROP` gets rid of that `<NextYear>` left around: Then, `OP_DROP` gets rid of that `<NextYear>` left around:
``` ```
Script: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG Script: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
Running: <NextYear> OP_DROP
Stack: [ <signature> <pubKey> ] Stack: [ <signature> <pubKey> ]
``` ```
Finally, the remainder of the script runs, which is a normal check of a signature and public key. Finally, the remainder of the script runs, which is a normal check of a signature and public key.