Skip to content

Commit eae2c57

Browse files
Alex Melvilledcousens
authored andcommitted
remove errant argument to buildInput in __build
1 parent 1d6b978 commit eae2c57

File tree

3 files changed

+13
-28
lines changed

3 files changed

+13
-28
lines changed

src/transaction_builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ function buildInput (input, allowIncomplete) {
399399
var sig = []
400400
var witness = []
401401
if (SIGNABLE.indexOf(scriptType) !== -1) {
402-
sig = buildStack(scriptType, input.signatures, input.pubKeys, input.script, allowIncomplete)
402+
sig = buildStack(scriptType, input.signatures, input.pubKeys, allowIncomplete)
403403
}
404404

405405
var p2sh = false

test/fixtures/transaction_builder.json

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,33 +1702,6 @@
17021702
}
17031703
]
17041704
},
1705-
{
1706-
"description": "Incomplete transaction w/ prevTxScript defined",
1707-
"exception": "Not enough signatures provided",
1708-
"incomplete": true,
1709-
"inputs": [
1710-
{
1711-
"txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
1712-
"vout": 0,
1713-
"signs": [
1714-
{
1715-
"keyPair": "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn"
1716-
}
1717-
]
1718-
},
1719-
{
1720-
"txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
1721-
"vout": 1,
1722-
"prevTxScript": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG"
1723-
}
1724-
],
1725-
"outputs": [
1726-
{
1727-
"script": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG",
1728-
"value": 1000
1729-
}
1730-
]
1731-
},
17321705
{
17331706
"description": "Duplicate transaction outs",
17341707
"exception": "Duplicate TxOut: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff:0",

test/transaction_builder.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,18 @@ describe('TransactionBuilder', function () {
354354
}
355355
})
356356
})
357+
358+
it('for incomplete with 0 signatures', function () {
359+
var randomTxData = '0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100aa5d8aa40a90f23ce2c3d11bc845ca4a12acd99cbea37de6b9f6d86edebba8cb022022dedc2aa0a255f74d04c0b76ece2d7c691f9dd11a64a8ac49f62a99c3a05f9d01232103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ac00000000'
360+
var randomAddress = '1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'
361+
362+
var randomTx = Transaction.fromHex(randomTxData)
363+
var tx = new TransactionBuilder()
364+
tx.addInput(randomTx, 0)
365+
tx.addOutput(baddress.toOutputScript(randomAddress), 1000)
366+
tx = tx.buildIncomplete()
367+
assert(tx)
368+
})
357369
})
358370

359371
describe('multisig', function () {

0 commit comments

Comments
 (0)