2014-06-16 08:05:31 +02:00
|
|
|
var assert = require('assert')
|
2015-02-11 04:01:20 +01:00
|
|
|
var ops = require('./opcodes')
|
2014-06-16 08:05:31 +02:00
|
|
|
var scripts = require('./scripts')
|
|
|
|
|
2014-07-28 06:28:44 +02:00
|
|
|
var ECPubKey = require('./ecpubkey')
|
|
|
|
var ECSignature = require('./ecsignature')
|
2014-06-16 08:05:31 +02:00
|
|
|
var Script = require('./script')
|
2014-07-28 06:28:44 +02:00
|
|
|
var Transaction = require('./transaction')
|
2014-06-16 08:05:31 +02:00
|
|
|
|
2015-01-06 06:05:38 +01:00
|
|
|
function isCoinbase(txHash) {
|
|
|
|
return Array.prototype.every.call(txHash, function(x) {
|
|
|
|
return x === 0
|
|
|
|
})
|
2014-06-16 08:05:31 +02:00
|
|
|
}
|
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
function extractInput(txIn) {
|
2014-12-12 02:48:04 +01:00
|
|
|
var redeemScript
|
|
|
|
var scriptSig = txIn.script
|
2015-01-06 02:33:49 +01:00
|
|
|
var prevOutScript
|
|
|
|
var prevOutType = scripts.classifyInput(scriptSig, true)
|
|
|
|
var scriptType
|
2014-12-12 02:48:04 +01:00
|
|
|
|
|
|
|
// Re-classify if P2SH
|
2015-01-06 02:33:49 +01:00
|
|
|
if (prevOutType === 'scripthash') {
|
2014-12-12 02:48:04 +01:00
|
|
|
redeemScript = Script.fromBuffer(scriptSig.chunks.slice(-1)[0])
|
2015-01-06 02:33:49 +01:00
|
|
|
prevOutScript = scripts.scriptHashOutput(redeemScript.getHash())
|
2014-12-12 02:48:04 +01:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
scriptSig = Script.fromChunks(scriptSig.chunks.slice(0, -1))
|
2014-12-12 02:48:04 +01:00
|
|
|
scriptType = scripts.classifyInput(scriptSig, true)
|
|
|
|
assert.equal(scripts.classifyOutput(redeemScript), scriptType, 'Non-matching scriptSig and scriptPubKey in input')
|
2015-01-06 02:33:49 +01:00
|
|
|
|
|
|
|
} else {
|
|
|
|
scriptType = prevOutType
|
2014-12-12 02:48:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Extract hashType, pubKeys and signatures
|
2015-01-06 02:33:49 +01:00
|
|
|
var hashType, initialized, parsed, pubKeys, signatures
|
2014-12-12 02:48:04 +01:00
|
|
|
|
|
|
|
switch (scriptType) {
|
|
|
|
case 'pubkeyhash':
|
|
|
|
parsed = ECSignature.parseScriptSignature(scriptSig.chunks[0])
|
|
|
|
hashType = parsed.hashType
|
2014-12-12 05:19:03 +01:00
|
|
|
pubKeys = [ECPubKey.fromBuffer(scriptSig.chunks[1])]
|
2014-12-12 02:48:04 +01:00
|
|
|
signatures = [parsed.signature]
|
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
initialized = true
|
|
|
|
prevOutScript = pubKeys[0].getAddress().toOutputScript()
|
|
|
|
|
2014-12-12 02:48:04 +01:00
|
|
|
break
|
|
|
|
|
|
|
|
case 'multisig':
|
2015-01-06 05:50:13 +01:00
|
|
|
signatures = scriptSig.chunks.slice(1).map(function(chunk) {
|
|
|
|
if (chunk === ops.OP_0) return chunk
|
2014-12-12 02:48:04 +01:00
|
|
|
|
2015-01-06 05:50:13 +01:00
|
|
|
var parsed = ECSignature.parseScriptSignature(chunk)
|
|
|
|
hashType = parsed.hashType
|
|
|
|
|
|
|
|
return parsed.signature
|
|
|
|
})
|
2014-12-12 02:48:04 +01:00
|
|
|
|
2014-12-12 05:19:03 +01:00
|
|
|
if (redeemScript) {
|
|
|
|
pubKeys = redeemScript.chunks.slice(1, -2).map(ECPubKey.fromBuffer)
|
|
|
|
}
|
|
|
|
|
2014-12-12 02:48:04 +01:00
|
|
|
break
|
|
|
|
|
|
|
|
case 'pubkey':
|
|
|
|
parsed = ECSignature.parseScriptSignature(scriptSig.chunks[0])
|
|
|
|
hashType = parsed.hashType
|
|
|
|
signatures = [parsed.signature]
|
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
initialized = true
|
|
|
|
|
2014-12-12 05:19:03 +01:00
|
|
|
if (redeemScript) {
|
|
|
|
pubKeys = [ECPubKey.fromBuffer(redeemScript.chunks[0])]
|
|
|
|
}
|
|
|
|
|
2014-12-12 02:48:04 +01:00
|
|
|
break
|
|
|
|
|
|
|
|
default:
|
2015-01-06 02:33:49 +01:00
|
|
|
if (redeemScript) {
|
|
|
|
initialized = true
|
|
|
|
}
|
|
|
|
|
|
|
|
break
|
2014-12-12 02:48:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
hashType: hashType,
|
2015-01-06 02:33:49 +01:00
|
|
|
initialized: initialized,
|
|
|
|
prevOutScript: prevOutScript,
|
|
|
|
prevOutType: prevOutType,
|
2014-12-12 02:48:04 +01:00
|
|
|
pubKeys: pubKeys,
|
|
|
|
redeemScript: redeemScript,
|
|
|
|
scriptType: scriptType,
|
|
|
|
signatures: signatures
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-06 06:05:38 +01:00
|
|
|
function TransactionBuilder() {
|
2015-01-05 05:30:04 +01:00
|
|
|
this.prevTxMap = {}
|
2015-01-06 06:05:38 +01:00
|
|
|
this.prevOutScripts = {}
|
|
|
|
this.prevOutTypes = {}
|
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
this.inputs = []
|
2015-01-06 06:05:38 +01:00
|
|
|
this.tx = new Transaction()
|
|
|
|
}
|
|
|
|
|
2014-08-18 00:59:26 +02:00
|
|
|
TransactionBuilder.fromTransaction = function(transaction) {
|
|
|
|
var txb = new TransactionBuilder()
|
|
|
|
|
2015-01-23 06:35:09 +01:00
|
|
|
// Copy other transaction fields
|
|
|
|
txb.tx.version = transaction.version
|
|
|
|
txb.tx.locktime = transaction.locktime
|
|
|
|
|
2014-08-18 00:59:26 +02:00
|
|
|
// Extract/add inputs
|
2014-12-02 04:20:04 +01:00
|
|
|
transaction.ins.forEach(function(txIn) {
|
|
|
|
txb.addInput(txIn.hash, txIn.index, txIn.sequence)
|
2014-08-18 00:59:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
// Extract/add outputs
|
2014-12-02 04:20:04 +01:00
|
|
|
transaction.outs.forEach(function(txOut) {
|
|
|
|
txb.addOutput(txOut.script, txOut.value)
|
2014-08-18 00:59:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
// Extract/add signatures
|
2015-01-06 02:33:49 +01:00
|
|
|
txb.inputs = transaction.ins.map(function(txIn) {
|
2015-01-06 05:50:13 +01:00
|
|
|
// TODO: remove me after testcase added
|
|
|
|
assert(!isCoinbase(txIn.hash), 'coinbase inputs not supported')
|
2014-08-30 06:35:46 +02:00
|
|
|
|
2014-12-12 02:48:04 +01:00
|
|
|
// Ignore empty scripts
|
|
|
|
if (txIn.script.buffer.length === 0) return
|
2014-08-18 00:59:26 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
return extractInput(txIn)
|
2014-08-18 00:59:26 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
return txb
|
|
|
|
}
|
|
|
|
|
2014-07-28 06:28:44 +02:00
|
|
|
TransactionBuilder.prototype.addInput = function(prevTx, index, sequence, prevOutScript) {
|
2014-06-16 08:05:31 +02:00
|
|
|
var prevOutHash
|
|
|
|
|
|
|
|
if (typeof prevTx === 'string') {
|
|
|
|
prevOutHash = new Buffer(prevTx, 'hex')
|
|
|
|
|
|
|
|
// TxId hex is big-endian, we want little-endian hash
|
|
|
|
Array.prototype.reverse.call(prevOutHash)
|
|
|
|
|
|
|
|
} else if (prevTx instanceof Transaction) {
|
|
|
|
prevOutHash = prevTx.getHash()
|
|
|
|
prevOutScript = prevTx.outs[index].script
|
|
|
|
|
|
|
|
} else {
|
|
|
|
prevOutHash = prevTx
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
var input = {}
|
|
|
|
if (prevOutScript) {
|
|
|
|
var prevOutType = scripts.classifyOutput(prevOutScript)
|
|
|
|
|
|
|
|
// if we can, extract pubKey information
|
|
|
|
switch (prevOutType) {
|
|
|
|
case 'multisig':
|
|
|
|
input.pubKeys = prevOutScript.chunks.slice(1, -2).map(ECPubKey.fromBuffer)
|
|
|
|
break
|
|
|
|
|
|
|
|
case 'pubkey':
|
|
|
|
input.pubKeys = prevOutScript.chunks.slice(0, 1).map(ECPubKey.fromBuffer)
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if (prevOutType !== 'scripthash') {
|
|
|
|
input.scriptType = prevOutType
|
|
|
|
}
|
2014-06-16 08:05:31 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
input.prevOutScript = prevOutScript
|
|
|
|
input.prevOutType = prevOutType
|
2014-06-16 08:05:31 +02:00
|
|
|
}
|
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
assert(this.inputs.every(function(input2) {
|
|
|
|
if (input2.hashType === undefined) return true
|
|
|
|
|
|
|
|
return input2.hashType & Transaction.SIGHASH_ANYONECANPAY
|
2014-06-16 08:05:31 +02:00
|
|
|
}), 'No, this would invalidate signatures')
|
|
|
|
|
|
|
|
var prevOut = prevOutHash.toString('hex') + ':' + index
|
2015-01-05 05:30:04 +01:00
|
|
|
assert(!(prevOut in this.prevTxMap), 'Transaction is already an input')
|
2014-06-16 08:05:31 +02:00
|
|
|
|
2014-07-25 10:30:39 +02:00
|
|
|
var vout = this.tx.addInput(prevOutHash, index, sequence)
|
2015-01-06 02:33:49 +01:00
|
|
|
|
2015-01-05 05:30:04 +01:00
|
|
|
this.prevTxMap[prevOut] = true
|
2015-01-06 02:33:49 +01:00
|
|
|
this.inputs[vout] = input
|
2014-06-16 08:05:31 +02:00
|
|
|
|
|
|
|
return vout
|
|
|
|
}
|
|
|
|
|
|
|
|
TransactionBuilder.prototype.addOutput = function(scriptPubKey, value) {
|
2015-01-06 02:33:49 +01:00
|
|
|
assert(this.inputs.every(function(input) {
|
|
|
|
if (input.hashType === undefined) return true
|
|
|
|
|
|
|
|
return (input.hashType & 0x1f) === Transaction.SIGHASH_SINGLE
|
2014-06-16 08:05:31 +02:00
|
|
|
}), 'No, this would invalidate signatures')
|
|
|
|
|
|
|
|
return this.tx.addOutput(scriptPubKey, value)
|
|
|
|
}
|
|
|
|
|
2015-02-05 03:30:35 +01:00
|
|
|
TransactionBuilder.prototype.build = function() { return this.__build(false) }
|
|
|
|
TransactionBuilder.prototype.buildIncomplete = function() { return this.__build(true) }
|
2014-08-15 05:13:36 +02:00
|
|
|
TransactionBuilder.prototype.__build = function(allowIncomplete) {
|
2014-06-16 08:05:31 +02:00
|
|
|
if (!allowIncomplete) {
|
|
|
|
assert(this.tx.ins.length > 0, 'Transaction has no inputs')
|
|
|
|
assert(this.tx.outs.length > 0, 'Transaction has no outputs')
|
|
|
|
}
|
|
|
|
|
|
|
|
var tx = this.tx.clone()
|
|
|
|
|
2014-07-28 06:28:44 +02:00
|
|
|
// Create script signatures from signature meta-data
|
2015-01-06 02:33:49 +01:00
|
|
|
this.inputs.forEach(function(input, index) {
|
|
|
|
if (!allowIncomplete) {
|
|
|
|
assert(input.initialized, 'Transaction is not complete')
|
|
|
|
}
|
2014-06-16 08:05:31 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
var scriptSig
|
2014-07-16 14:37:28 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
switch (input.scriptType) {
|
2014-07-28 06:28:44 +02:00
|
|
|
case 'pubkeyhash':
|
2015-01-06 02:33:49 +01:00
|
|
|
assert(input.signatures, 'Transaction is missing signatures')
|
|
|
|
assert.equal(input.signatures.length, 1, 'Transaction is missing signatures')
|
2014-07-28 06:28:44 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
var pkhSignature = input.signatures[0].toScriptSignature(input.hashType)
|
|
|
|
scriptSig = scripts.pubKeyHashInput(pkhSignature, input.pubKeys[0])
|
2014-07-28 06:28:44 +02:00
|
|
|
break
|
2014-07-28 07:40:07 +02:00
|
|
|
|
2014-07-28 06:28:44 +02:00
|
|
|
case 'multisig':
|
2015-01-06 02:33:49 +01:00
|
|
|
assert(input.signatures, 'Transaction is missing signatures')
|
|
|
|
|
2015-01-06 05:50:13 +01:00
|
|
|
// Array.prototype.map is sparse-compatible
|
|
|
|
var msSignatures = input.signatures.map(function(signature) {
|
2015-01-06 02:33:49 +01:00
|
|
|
return signature.toScriptSignature(input.hashType)
|
2015-01-06 05:50:13 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
// fill in blanks with OP_0
|
|
|
|
for (var i = 0; i < msSignatures.length; ++i) {
|
|
|
|
if (msSignatures[i]) continue
|
|
|
|
|
|
|
|
msSignatures[i] = ops.OP_0
|
|
|
|
}
|
2015-01-06 02:33:49 +01:00
|
|
|
|
2014-07-28 06:28:44 +02:00
|
|
|
var redeemScript = allowIncomplete ? undefined : input.redeemScript
|
|
|
|
scriptSig = scripts.multisigInput(signatures, redeemScript)
|
|
|
|
break
|
2014-07-28 07:40:07 +02:00
|
|
|
|
2014-07-28 06:28:44 +02:00
|
|
|
case 'pubkey':
|
2015-01-06 02:33:49 +01:00
|
|
|
assert(input.signatures, 'Transaction is missing signatures')
|
|
|
|
assert.equal(input.signatures.length, 1, 'Transaction is missing signatures')
|
2014-07-28 06:28:44 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
var pkSignature = input.signatures[0].toScriptSignature(input.hashType)
|
|
|
|
scriptSig = scripts.pubKeyInput(pkSignature)
|
2014-07-28 06:28:44 +02:00
|
|
|
break
|
2014-07-28 07:40:07 +02:00
|
|
|
|
2014-07-28 06:28:44 +02:00
|
|
|
default:
|
2015-01-06 02:33:49 +01:00
|
|
|
if (allowIncomplete) return
|
|
|
|
|
|
|
|
assert(false, input.scriptType + ' not supported')
|
2014-06-16 08:05:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (input.redeemScript) {
|
|
|
|
scriptSig = scripts.scriptHashInput(scriptSig, input.redeemScript)
|
|
|
|
}
|
|
|
|
|
|
|
|
tx.setInputScript(index, scriptSig)
|
|
|
|
})
|
|
|
|
|
|
|
|
return tx
|
|
|
|
}
|
|
|
|
|
2015-02-04 09:36:21 +01:00
|
|
|
var canSignTypes = { 'pubkeyhash': true, 'multisig': true, 'pubkey': true }
|
|
|
|
|
2014-08-18 00:59:26 +02:00
|
|
|
TransactionBuilder.prototype.sign = function(index, privKey, redeemScript, hashType) {
|
2015-01-06 02:33:49 +01:00
|
|
|
assert(index in this.inputs, 'No input at index: ' + index)
|
2014-08-18 00:59:26 +02:00
|
|
|
hashType = hashType || Transaction.SIGHASH_ALL
|
2014-07-28 06:28:44 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
var input = this.inputs[index]
|
2014-07-28 06:28:44 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
if (input.hashType !== undefined) {
|
|
|
|
assert.equal(input.hashType, hashType, 'Inconsistent hashType')
|
|
|
|
}
|
2014-07-28 07:40:07 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
// are we already initialized?
|
|
|
|
if (input.initialized) {
|
|
|
|
// redeemScript only needed to initialize, but if provided again, enforce consistency
|
|
|
|
if (redeemScript) {
|
|
|
|
assert.deepEqual(input.redeemScript, redeemScript, 'Inconsistent redeemScript')
|
|
|
|
}
|
2014-07-28 07:40:07 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
// if signatures already exist, enforce multisig scriptType
|
|
|
|
if (input.signatures.length > 0) {
|
|
|
|
assert.equal(input.scriptType, 'multisig', input.scriptType + ' doesn\'t support multiple signatures')
|
|
|
|
}
|
2014-07-28 06:28:44 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
// initialize it
|
2014-08-18 00:59:26 +02:00
|
|
|
} else {
|
2015-01-06 02:33:49 +01:00
|
|
|
if (redeemScript) {
|
|
|
|
if (input.prevOutScript) {
|
|
|
|
assert.equal(input.prevOutType, 'scripthash', 'PrevOutScript must be P2SH')
|
2014-07-28 06:28:44 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
var scriptHash = input.prevOutScript.chunks[1]
|
|
|
|
assert.deepEqual(scriptHash, redeemScript.getHash(), 'RedeemScript does not match ' + scriptHash.toString('hex'))
|
|
|
|
}
|
2014-07-28 07:40:07 +02:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
var scriptType = scripts.classifyOutput(redeemScript)
|
2015-02-04 10:02:10 +01:00
|
|
|
assert(scriptType in canSignTypes, 'RedeemScript not supported (' + scriptType + ')')
|
2015-01-06 02:33:49 +01:00
|
|
|
|
2015-02-04 10:02:10 +01:00
|
|
|
var pubKeys = []
|
2015-01-06 02:33:49 +01:00
|
|
|
switch (scriptType) {
|
|
|
|
case 'multisig':
|
2015-02-04 10:02:10 +01:00
|
|
|
pubKeys = redeemScript.chunks.slice(1, -2).map(ECPubKey.fromBuffer)
|
2015-01-06 02:33:49 +01:00
|
|
|
break
|
|
|
|
|
|
|
|
case 'pubkeyhash':
|
|
|
|
var pkh1 = redeemScript.chunks[2]
|
|
|
|
var pkh2 = privKey.pub.getAddress().hash
|
|
|
|
|
|
|
|
assert.deepEqual(pkh1, pkh2, 'privateKey cannot sign for this input')
|
2015-02-04 10:02:10 +01:00
|
|
|
pubKeys = [privKey.pub]
|
2015-01-06 02:33:49 +01:00
|
|
|
break
|
|
|
|
|
|
|
|
case 'pubkey':
|
2015-02-04 10:02:10 +01:00
|
|
|
pubKeys = redeemScript.chunks.slice(0, 1).map(ECPubKey.fromBuffer)
|
2015-01-06 02:33:49 +01:00
|
|
|
break
|
2015-02-04 10:02:10 +01:00
|
|
|
}
|
2014-07-28 06:28:44 +02:00
|
|
|
|
2015-02-04 10:02:10 +01:00
|
|
|
if (!input.prevOutScript) {
|
|
|
|
input.prevOutScript = scripts.scriptHashOutput(redeemScript.getHash())
|
|
|
|
input.prevOutType = 'scripthash'
|
2015-01-06 02:33:49 +01:00
|
|
|
}
|
2014-12-12 05:19:03 +01:00
|
|
|
|
2015-02-04 10:02:10 +01:00
|
|
|
input.pubKeys = pubKeys
|
2015-01-06 02:33:49 +01:00
|
|
|
input.redeemScript = redeemScript
|
|
|
|
input.scriptType = scriptType
|
2014-12-12 05:19:03 +01:00
|
|
|
|
|
|
|
} else {
|
2015-01-06 02:33:49 +01:00
|
|
|
assert.notEqual(input.prevOutType, 'scripthash', 'PrevOutScript is P2SH, missing redeemScript')
|
2014-12-12 05:19:03 +01:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
if (!input.scriptType) {
|
|
|
|
input.prevOutScript = privKey.pub.getAddress().toOutputScript()
|
|
|
|
input.prevOutType = 'pubkeyhash'
|
|
|
|
input.pubKeys = [privKey.pub]
|
|
|
|
input.scriptType = input.prevOutType
|
|
|
|
}
|
2014-07-28 06:28:44 +02:00
|
|
|
}
|
2014-12-12 04:48:31 +01:00
|
|
|
|
2015-01-06 02:33:49 +01:00
|
|
|
input.hashType = hashType
|
|
|
|
input.initialized = true
|
|
|
|
input.signatures = input.signatures || []
|
|
|
|
}
|
|
|
|
|
2015-02-04 09:36:21 +01:00
|
|
|
// do we know how to sign this?
|
|
|
|
assert(input.scriptType in canSignTypes, input.scriptType + ' not supported')
|
2015-01-06 02:33:49 +01:00
|
|
|
|
2015-02-04 10:02:10 +01:00
|
|
|
var signatureScript = input.redeemScript || input.prevOutScript
|
|
|
|
var signatureHash = this.tx.hashForSignature(index, signatureScript, hashType)
|
2015-01-06 02:33:49 +01:00
|
|
|
var signature = privKey.sign(signatureHash)
|
|
|
|
|
2014-12-12 05:19:03 +01:00
|
|
|
// enforce signing in order of public keys
|
|
|
|
assert(input.pubKeys.some(function(pubKey, i) {
|
2015-01-06 02:33:49 +01:00
|
|
|
if (!privKey.pub.Q.equals(pubKey.Q)) return false
|
2014-12-12 05:19:03 +01:00
|
|
|
|
|
|
|
assert(!input.signatures[i], 'Signature already exists')
|
2015-01-06 02:33:49 +01:00
|
|
|
input.signatures[i] = signature
|
2014-08-18 00:59:26 +02:00
|
|
|
|
2014-12-12 05:19:03 +01:00
|
|
|
return true
|
|
|
|
}), 'privateKey cannot sign for this input')
|
2014-07-28 06:28:44 +02:00
|
|
|
}
|
|
|
|
|
2014-06-16 08:05:31 +02:00
|
|
|
module.exports = TransactionBuilder
|