From 1213782b3ea19c901ffd9f0072bb503ead2c40f9 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 2 Oct 2016 02:24:51 -0700 Subject: [PATCH] wallet: misc. --- lib/node/spvnode.js | 4 ++-- lib/wallet/walletdb.js | 2 +- lib/wallet/walletkey.js | 26 +++++++++++++------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/node/spvnode.js b/lib/node/spvnode.js index e56fb1cd..2bdcf056 100644 --- a/lib/node/spvnode.js +++ b/lib/node/spvnode.js @@ -135,8 +135,8 @@ SPVNode.prototype._init = function _init() { self.walletdb.addBlock(entry, block.txs).catch(onError); }); - this.walletdb.on('save address', function(address, path) { - self.pool.watch(address.getHash()); + this.walletdb.on('path', function(path) { + self.pool.watch(path.hash, 'hex'); }); this.walletdb.on('send', function(tx) { diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index 14488703..9ce31447 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -990,7 +990,7 @@ WalletDB.prototype.savePath = co(function* savePath(wid, path) { if (this.filter) this.filter.add(hash, 'hex'); - this.emit('save address', path.toAddress(), path); + this.emit('path', path); wallets = yield this.getWalletsByHash(hash); diff --git a/lib/wallet/walletkey.js b/lib/wallet/walletkey.js index 376b5272..03b71d3f 100644 --- a/lib/wallet/walletkey.js +++ b/lib/wallet/walletkey.js @@ -53,7 +53,7 @@ WalletKey.fromOptions = function fromOptions(options) { }; /** - * Instantiate keyring from a private key. + * Instantiate wallet key from a private key. * @param {Buffer} key * @param {Boolean?} compressed * @param {(NetworkType|Network}) network @@ -65,7 +65,7 @@ WalletKey.fromPrivate = function fromPrivate(key, compressed, network) { }; /** - * Generate a keyring. + * Generate a wallet key. * @param {(Network|NetworkType)?} network * @returns {WalletKey} */ @@ -75,7 +75,7 @@ WalletKey.generate = function(compressed, network) { }; /** - * Instantiate keyring from a public key. + * Instantiate wallet key from a public key. * @param {Buffer} publicKey * @param {(NetworkType|Network}) network * @returns {WalletKey} @@ -86,7 +86,7 @@ WalletKey.fromPublic = function fromPublic(key, network) { }; /** - * Instantiate keyring from a public key. + * Instantiate wallet key from a public key. * @param {Buffer} publicKey * @param {(NetworkType|Network}) network * @returns {WalletKey} @@ -97,7 +97,7 @@ WalletKey.fromKey = function fromKey(key, compressed, network) { }; /** - * Instantiate keyring from script. + * Instantiate wallet key from script. * @param {Buffer} key * @param {Script} script * @param {(NetworkType|Network}) network @@ -109,7 +109,7 @@ WalletKey.fromScript = function fromScript(key, script, compressed, network) { }; /** - * Instantiate a keyring from a serialized CBitcoinSecret. + * Instantiate a wallet key from a serialized CBitcoinSecret. * @param {Base58String} secret * @returns {WalletKey} */ @@ -153,7 +153,7 @@ WalletKey.fromJSON = function fromJSON(json) { }; /** - * Instantiate a keyring from serialized data. + * Instantiate a wallet key from serialized data. * @param {Buffer} data * @returns {WalletKey} */ @@ -163,7 +163,7 @@ WalletKey.fromRaw = function fromRaw(data) { }; /** - * Instantiate a keyring from serialized data. + * Instantiate a wallet key from serialized data. * @param {Buffer} data * @returns {WalletKey} */ @@ -186,7 +186,7 @@ WalletKey.prototype.fromHD = function fromHD(account, key, branch, index) { }; /** - * Instantiate a keyring from serialized data. + * Instantiate a wallet key from serialized data. * @param {Buffer} data * @returns {WalletKey} */ @@ -196,7 +196,7 @@ WalletKey.fromHD = function fromHD(account, key, branch, index) { }; /** - * Instantiate a keyring from serialized data. + * Instantiate a wallet key from serialized data. * @param {Buffer} data * @returns {WalletKey} */ @@ -212,7 +212,7 @@ WalletKey.prototype.fromImport = function fromImport(account, data, network) { }; /** - * Instantiate a keyring from serialized data. + * Instantiate a wallet key from serialized data. * @param {Buffer} data * @returns {WalletKey} */ @@ -222,7 +222,7 @@ WalletKey.fromImport = function fromImport(account, data, network) { }; /** - * Instantiate a keyring from serialized data. + * Instantiate a wallet key from serialized data. * @param {Buffer} data * @returns {WalletKey} */ @@ -238,7 +238,7 @@ WalletKey.prototype.fromRing = function fromRing(account, ring) { }; /** - * Instantiate a keyring from serialized data. + * Instantiate a wallet key from serialized data. * @param {Buffer} data * @returns {WalletKey} */