Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
906accd
TxBuilder: extract extractSignatures to free function
dcousens Dec 12, 2014
46db11e
TxBuilder: extract isCoinbaseHash function
dcousens Jan 6, 2015
ebe34db
TxBuilder: avoid var redeclaration due to hoisting
dcousens Jan 5, 2015
ba97b5e
TxBuilder: re-order to avoid mutation in case of failure
dcousens Dec 12, 2014
c29b233
TxBuilder: build convenience functions don't need extra line breaks
dcousens Feb 5, 2015
dfe74fa
TxBuilder: sign now signs inputs in known publicKey order
dcousens Dec 12, 2014
b629a03
TxBuilder: rename prevOutMap to prevTxMap
dcousens Jan 5, 2015
35fa86c
tests: add [failing] raw multisig fixture for TxBuilder
dcousens Jan 5, 2015
396e4d4
tests: add [failing] test for nulldata signing
dcousens Jan 6, 2015
b048627
tests: move TxBuilder.sign tests to fixtures
dcousens Jan 6, 2015
4c9fd60
TxBuilder: fix failing test for non-standard/multisig inputs
dcousens Jan 6, 2015
23a37fb
TxBuilder: fix out-of-order multisignature signing
dcousens Jan 6, 2015
95911c5
tests: consistent test data names
dcousens Jan 6, 2015
3f53b52
tests: reduce setup-code duplication
dcousens Jan 28, 2015
f0c4a76
tests: add scriptHash(pubKey) test fixture
dcousens Jan 28, 2015
ebbe127
tests: add non-standard input fixture
dcousens Jan 28, 2015
1fde0a4
tests: move inconsistent hashType/redeemScript test
dcousens Feb 4, 2015
5f76111
tests: if description undefined, use exception
dcousens Feb 4, 2015
d3af28e
tests: fix TxBuilder fixtures to be consistent w/ compression
dcousens Feb 5, 2015
085b813
TxBuilder: replace switch lookup with object lookup
dcousens Feb 4, 2015
8a8f40e
TxBuilder: defer mutation as long as possible
dcousens Feb 4, 2015
b55e3a0
TxBuilder: missing redeemScript not an issue if already added
dcousens Feb 4, 2015
e33a640
TxBuilder: add explanation for prevOutScript branch
dcousens Feb 4, 2015
c7c5830
TxBuilder: avoid unnecessary assertion, already done in classification
dcousens Feb 5, 2015
986e9d4
TxBuilder: vout is actually vin for addInput
dcousens Feb 5, 2015
fd2311b
TxBuilder: remove impossible/untestable assertions
dcousens Feb 5, 2015
3a371fc
TxBuilder: remove initialized field from signature inputs
dcousens Feb 5, 2015
a788214
TxBuilder: fix undefined scriptSig
dcousens Feb 5, 2015
4ef2c19
TxBuilder: defer mutation further, but still catch non-standards
dcousens Feb 5, 2015
73bf8a4
TxBuilder: hashtype only relevant to things we can sign
dcousens Feb 5, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ function isPubKeyOutput(script) {

function isScriptHashInput(script, allowIncomplete) {
if (script.chunks.length < 2) return false
var lastChunk = script.chunks[script.chunks.length - 1]

var lastChunk = script.chunks[script.chunks.length - 1]
if (!Buffer.isBuffer(lastChunk)) return false

var scriptSig = Script.fromChunks(script.chunks.slice(0, -1))
Expand Down
3 changes: 3 additions & 0 deletions src/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ Transaction.prototype.toHex = function() {
}

Transaction.prototype.setInputScript = function(index, script) {
typeForce('Number', index)
typeForce('Script', script)

this.ins[index].script = script
}

Expand Down
Loading