|
|
@ -254,14 +254,14 @@ Address._transformScript = function(script, network) { |
|
|
|
} else if (script.isPublicKeyHashOut()) { |
|
|
|
info.hashBuffer = script.getData(); |
|
|
|
info.type = Address.PayToPublicKeyHash; |
|
|
|
} else if (script.isScriptHashIn()) { |
|
|
|
// hash the redeemscript found at the end of the scriptSig
|
|
|
|
info.hashBuffer = Hash.sha256ripemd160(script.chunks[script.chunks.length - 1].buf); |
|
|
|
info.type = Address.PayToScriptHash; |
|
|
|
} else if (script.isPublicKeyHashIn()) { |
|
|
|
// hash the publickey found in the scriptSig
|
|
|
|
info.hashBuffer = Hash.sha256ripemd160(script.chunks[1].buf); |
|
|
|
info.type = Address.PayToPublicKeyHash; |
|
|
|
} else if (script.isScriptHashIn()) { |
|
|
|
// hash the redeemscript found at the end of the scriptSig
|
|
|
|
info.hashBuffer = Hash.sha256ripemd160(script.chunks[script.chunks.length - 1].buf); |
|
|
|
info.type = Address.PayToScriptHash; |
|
|
|
} else { |
|
|
|
throw new errors.Script.CantDeriveAddress(script); |
|
|
|
} |
|
|
|