s/scriptPubKey/outputScript
This commit is contained in:
parent
14f9218389
commit
3635a9f078
1 changed files with 4 additions and 4 deletions
|
@ -25,13 +25,13 @@ function toBase58Check (hash, version) {
|
|||
return bs58check.encode(payload)
|
||||
}
|
||||
|
||||
function fromOutputScript (scriptPubKey, network) {
|
||||
function fromOutputScript (outputScript, network) {
|
||||
network = network || networks.bitcoin
|
||||
|
||||
if (bscript.pubKeyHash.output.check(scriptPubKey)) return toBase58Check(bscript.compile(scriptPubKey).slice(3, 23), network.pubKeyHash)
|
||||
if (bscript.scriptHash.output.check(scriptPubKey)) return toBase58Check(bscript.compile(scriptPubKey).slice(2, 22), network.scriptHash)
|
||||
if (bscript.pubKeyHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(3, 23), network.pubKeyHash)
|
||||
if (bscript.scriptHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(2, 22), network.scriptHash)
|
||||
|
||||
throw new Error(bscript.toASM(scriptPubKey) + ' has no matching Address')
|
||||
throw new Error(bscript.toASM(outputScript) + ' has no matching Address')
|
||||
}
|
||||
|
||||
function toOutputScript (address, network) {
|
||||
|
|
Loading…
Reference in a new issue