Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txscript: Implement CheckLockTimeVerify (BIP0065) #459

Merged
merged 1 commit into from
Oct 14, 2015
Merged

txscript: Implement CheckLockTimeVerify (BIP0065) #459

merged 1 commit into from
Oct 14, 2015

Conversation

dajohi
Copy link
Member

@dajohi dajohi commented Jun 29, 2015

This commit mimics Bitcoin Core commit bc60b2b4b401f0adff5b8b9678903ff8feb5867b and includes additional tests from cb54d17355864fa08826d6511a0d7692b21ef2c9.

@dajohi
Copy link
Member Author

dajohi commented Sep 29, 2015

This requires #455 first.

@@ -413,6 +415,8 @@ var opcodeArray = [256]opcode{
OP_ENDIF: {OP_ENDIF, "OP_ENDIF", 1, opcodeEndif},
OP_VERIFY: {OP_VERIFY, "OP_VERIFY", 1, opcodeVerify},
OP_RETURN: {OP_RETURN, "OP_RETURN", 1, opcodeReturn},
OP_CHECKLOCKTIMEVERIFY: {OP_CHECKLOCKTIMEVERIFY,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the code is generally kept to 80, but I think for consistency, given every other entry, even those that are longer, are on a single line, this one should be too.

@davecgh
Copy link
Member

davecgh commented Oct 10, 2015

Aside from the minor things I pointed out, this looks good. I manually decoded each of the tx tests (both valid and invalid) and verified they are testing the intended things. I also did a thorough comparison audit since this will ultimately affect consensus. Finally, the test coverage from the tests is sufficient to cover all branches in the new function:

github.com\btcsuite\btcd\txscript\opcode.go:1016: opcodeCheckLockTimeVerify 100.0%

@jrick
Copy link
Member

jrick commented Oct 13, 2015

Consensus wise it appears correct. Made a couple nits but they're just my suggestions. Not too happy with copying Core's comments verbatim.

See https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki for
more information.

This commit mimics Bitcoin Core commit bc60b2b4b401f0adff5b8b9678903ff8feb5867b
and includes additional tests from Bitcoin Core commit
cb54d17355864fa08826d6511a0d7692b21ef2c9
@dajohi
Copy link
Member Author

dajohi commented Oct 14, 2015

Comments updated w/ help from @davecgh

@davecgh
Copy link
Member

davecgh commented Oct 14, 2015

OK

@conformal-deploy conformal-deploy merged commit 4c3ad49 into btcsuite:master Oct 14, 2015
@dajohi dajohi deleted the ctlv branch October 14, 2015 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants