Browse Source

Merge pull request #1283 from bitcoinjs/junderw-patch-1

Add notes for learners about nSequence + LockTime
v4
Daniel Cousens 6 years ago
committed by GitHub
parent
commit
f57a73496d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      test/integration/cltv.js

4
test/integration/cltv.js

@ -50,6 +50,7 @@ describe('bitcoinjs-lib (transactions w/ CLTV)', function () {
const txb = new bitcoin.TransactionBuilder(regtest)
txb.setLockTime(lockTime)
// Note: nSequence MUST be <= 0xfffffffe otherwise LockTime is ignored, and is immediately spendable.
txb.addInput(unspent.txId, unspent.vout, 0xfffffffe)
txb.addOutput(regtestUtils.RANDOM_ADDRESS, 7e4)
@ -96,6 +97,7 @@ describe('bitcoinjs-lib (transactions w/ CLTV)', function () {
const txb = new bitcoin.TransactionBuilder(regtest)
txb.setLockTime(lockTime)
// Note: nSequence MUST be <= 0xfffffffe otherwise LockTime is ignored, and is immediately spendable.
txb.addInput(unspent.txId, unspent.vout, 0xfffffffe)
txb.addOutput(regtestUtils.RANDOM_ADDRESS, 7e4)
@ -147,6 +149,7 @@ describe('bitcoinjs-lib (transactions w/ CLTV)', function () {
const txb = new bitcoin.TransactionBuilder(regtest)
txb.setLockTime(lockTime)
// Note: nSequence MUST be <= 0xfffffffe otherwise LockTime is ignored, and is immediately spendable.
txb.addInput(unspent.txId, unspent.vout, 0xfffffffe)
txb.addOutput(regtestUtils.RANDOM_ADDRESS, 8e4)
@ -191,6 +194,7 @@ describe('bitcoinjs-lib (transactions w/ CLTV)', function () {
const txb = new bitcoin.TransactionBuilder(regtest)
txb.setLockTime(lockTime)
// Note: nSequence MUST be <= 0xfffffffe otherwise LockTime is ignored, and is immediately spendable.
txb.addInput(unspent.txId, unspent.vout, 0xfffffffe)
txb.addOutput(regtestUtils.RANDOM_ADDRESS, 1e4)

Loading…
Cancel
Save