Skip to content

Commit 84e330d

Browse files
author
Thomas Kerin
committed
hdnode: expose getScriptData
1 parent f44e662 commit 84e330d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/hdnode.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,13 @@ HDNode.fromBase58 = function (string, networks, prefixes) {
148148
return hd
149149
}
150150

151+
HDNode.prototype.getScriptData = function () {
152+
return this.prefix.scriptFactory.convert(this.keyPair)
153+
}
154+
151155
HDNode.prototype.getAddress = function () {
152-
var data = this.prefix.scriptFactory.convert(this.keyPair)
153-
return baddress.fromOutputScript(data.scriptPubKey, this.keyPair.network)
156+
var scriptData = this.getScriptData()
157+
return baddress.fromOutputScript(scriptData.scriptPubKey, this.keyPair.network)
154158
}
155159

156160
HDNode.prototype.getIdentifier = function () {

0 commit comments

Comments
 (0)