diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 186c93d..5806063 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -37,7 +37,7 @@ function extractInput (txIn) { hashType = parsed.hashType pubKeys = scriptSig.chunks.slice(1) signatures = [parsed.signature] - prevOutScript = Address.toOutputScript(ECPair.fromPublicKeyBuffer(pubKeys[0]).getAddress()) + prevOutScript = scripts.pubKeyHashOutput(bcrypto.hash160(pubKeys[0])) break } @@ -358,7 +358,7 @@ TransactionBuilder.prototype.sign = function (index, keyPair, redeemScript, hash // we know nothin' Jon Snow, assume pubKeyHash } else { - input.prevOutScript = Address.toOutputScript(keyPair.getAddress()) + input.prevOutScript = scripts.pubKeyHashOutput(bcrypto.hash160(keyPair.getPublicKeyBuffer())) input.prevOutType = 'pubkeyhash' input.pubKeys = [kpPubKey] input.scriptType = input.prevOutType