From 7129370b2b638da7d36ce5566341a823abb43364 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 17 Jun 2017 18:49:28 -0700 Subject: [PATCH] walletkey: fix getType in toJSON. --- lib/wallet/walletkey.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/wallet/walletkey.js b/lib/wallet/walletkey.js index 0c98affb..19510216 100644 --- a/lib/wallet/walletkey.js +++ b/lib/wallet/walletkey.js @@ -7,10 +7,11 @@ 'use strict'; -var KeyRing = require('../primitives/keyring'); var util = require('../utils/util'); -var Path = require('./path'); +var Address = require('../primitives/address'); +var KeyRing = require('../primitives/keyring'); var Script = require('../script/script'); +var Path = require('./path'); /** * Represents a key ring which amounts to an address. @@ -133,7 +134,7 @@ WalletKey.prototype.toJSON = function toJSON() { publicKey: this.publicKey.toString('hex'), script: this.script ? this.script.toRaw().toString('hex') : null, program: this.witness ? this.getProgram().toRaw().toString('hex') : null, - type: Script.typesByVal[this.getType()].toLowerCase(), + type: Address.typesByVal[this.getType()].toLowerCase(), address: this.getAddress('string') }; };