Skip to content

Commit 3635a9f

Browse files
committed
s/scriptPubKey/outputScript
1 parent 14f9218 commit 3635a9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/address.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ function toBase58Check (hash, version) {
2525
return bs58check.encode(payload)
2626
}
2727

28-
function fromOutputScript (scriptPubKey, network) {
28+
function fromOutputScript (outputScript, network) {
2929
network = network || networks.bitcoin
3030

31-
if (bscript.pubKeyHash.output.check(scriptPubKey)) return toBase58Check(bscript.compile(scriptPubKey).slice(3, 23), network.pubKeyHash)
32-
if (bscript.scriptHash.output.check(scriptPubKey)) return toBase58Check(bscript.compile(scriptPubKey).slice(2, 22), network.scriptHash)
31+
if (bscript.pubKeyHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(3, 23), network.pubKeyHash)
32+
if (bscript.scriptHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(2, 22), network.scriptHash)
3333

34-
throw new Error(bscript.toASM(scriptPubKey) + ' has no matching Address')
34+
throw new Error(bscript.toASM(outputScript) + ' has no matching Address')
3535
}
3636

3737
function toOutputScript (address, network) {

0 commit comments

Comments
 (0)