BIP-112: Mempool-only CHECKSEQUENCEVERIFY#7524
Merged
laanwj merged 3 commits intobitcoin:masterfrom Feb 16, 2016
Merged
Conversation
Contributor
|
My comment remains that I would prefer VerifyLockTime not be encapsulated for reuse for nLockTime and nSequence checks. |
Contributor
Author
|
@morcos @petertodd I agree the encapsulation hampers readability. I propose something like 2fcd56f. |
Contributor
|
ACK 2fcd56f |
Member
|
utACK btcdrak@2fcd56f |
- Replace NOP3 with CHECKSEQUENCEVERIFY (BIP112) <nSequence> CHECKSEQUENCEVERIFY -> <nSequence> - Fails if txin.nSequence < nSequence, allowing funds of a txout to be locked for a number of blocks or a duration of time after its inclusion in a block. - Pull most of CheckLockTime() out into VerifyLockTime(), a local function that will be reused for CheckSequence() - Add bitwise AND operator to CScriptNum - Enable CHECKSEQUENCEVERIFY as a standard script verify flag - Transactions that fail CSV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CSV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CSV for production use.
For the sake of a little repetition, make code more readable.
2fcd56f to
c3c3752
Compare
Contributor
Author
|
I've squashed to two commits. 53e53a3 corresponds to the state of #6564 as per OP and c3c3752 (was 2fcd56f) addresses request from @morcos and @petertodd. Previous branch state for verification |
| (txToSequenceMasked < CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG && nSequenceMasked < CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) || | ||
| (txToSequenceMasked >= CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG && nSequenceMasked >= CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) | ||
| )) | ||
| return false; |
Member
There was a problem hiding this comment.
This return false here seems to come out of the blue, which could make people misread the code and introduce bugs. I'd suggest adding the )) to the line before it, or surrounding with {}.
Member
|
utACK 2fcd56f |
This if statement is a little obtuse and using braces here improves readability.
laanwj
added a commit
that referenced
this pull request
Feb 16, 2016
1 task
wqking
added a commit
to wqking-misc/Phore
that referenced
this pull request
Apr 26, 2018
wqking
added a commit
to wqking-misc/Phore
that referenced
this pull request
Apr 26, 2018
… txOut is empty, the function CheckTransaction in Phore rejects empty txOut while Bitcoin doesn't.
meyer9
pushed a commit
to phoreproject/Phore
that referenced
this pull request
Jun 16, 2018
meyer9
pushed a commit
to phoreproject/Phore
that referenced
this pull request
Jun 16, 2018
… txOut is empty, the function CheckTransaction in Phore rejects empty txOut while Bitcoin doesn't.
meyer9
pushed a commit
to phoreproject/Phore
that referenced
this pull request
Jun 16, 2018
meyer9
pushed a commit
to phoreproject/Phore
that referenced
this pull request
Jun 16, 2018
… txOut is empty, the function CheckTransaction in Phore rejects empty txOut while Bitcoin doesn't.
meyer9
pushed a commit
to phoreproject/Phore
that referenced
this pull request
Jul 4, 2018
meyer9
pushed a commit
to phoreproject/Phore
that referenced
this pull request
Jul 4, 2018
… txOut is empty, the function CheckTransaction in Phore rejects empty txOut while Bitcoin doesn't.
wqking
added a commit
to wqking-misc/SocialSend
that referenced
this pull request
Apr 4, 2021
# Conflicts: # src/script/interpreter.cpp # src/script/interpreter.h # src/script/script.h
wqking
added a commit
to wqking-misc/SocialSend
that referenced
this pull request
Apr 4, 2021
…ause the txOut is empty, the function CheckTransaction in Phore rejects empty txOut while Bitcoin doesn't.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace NOP3 with CHECKSEQUENCEVERIFY (BIP-112)
The BIP text is at https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki
This PR follows on from #6564 and is rebased (with #7184 which has been merged top
master) so can now be tested directly.Functional test scripts by @ajtowns can be found at https://github.com/ajtowns/op_csv-test
For reviewers please note that #6564 remained unchanged for several months. The list of reviews in #6564 were as follows: