From 02cc97b0a1a2834b093748900f8da4f14f06494d Mon Sep 17 00:00:00 2001 From: Sky Young Date: Fri, 16 Aug 2019 09:24:20 -0600 Subject: [PATCH] Pass network to Address.toString() --- addresses.txt | 1 - lib/services/address/index.js | 8 ++++---- lib/utils.js | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 addresses.txt diff --git a/addresses.txt b/addresses.txt deleted file mode 100644 index 174cedb9..00000000 --- a/addresses.txt +++ /dev/null @@ -1 +0,0 @@ -mtLDA41NWe9rLm7nuMvAnTs2SbP49cz1ZR diff --git a/lib/services/address/index.js b/lib/services/address/index.js index 9bc6371a..84ba9da0 100644 --- a/lib/services/address/index.js +++ b/lib/services/address/index.js @@ -630,7 +630,7 @@ AddressService.prototype._removeInput = function(input, tx, block, index, callba } address.network = self._network; - address = address.toString(); + address = address.toString(self._network); assert(block && block.__ts && block.__height, 'Missing block or block values.'); @@ -674,7 +674,7 @@ AddressService.prototype._removeOutput = function(output, tx, block, index, call } address.network = self._network; - address = address.toString(); + address = address.toString(self._network); assert(block && block.__ts && block.__height, 'Missing block or block values.'); @@ -743,7 +743,7 @@ AddressService.prototype._processInput = function(tx, input, index, opts) { } address.network = this._network; - address = address.toString(); + address = address.toString(this._network); var txid = tx.txid(); var timestamp = this._timestamp.getTimestampSync(opts.block.rhash()); @@ -781,7 +781,7 @@ AddressService.prototype._processOutput = function(tx, output, index, opts) { } address.network = this._network; - address = address.toString(); + address = address.toString(this._network); var txid = tx.txid(); var timestamp = this._timestamp.getTimestampSync(opts.block.rhash()); diff --git a/lib/utils.js b/lib/utils.js index 9c93f718..c6ddb011 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -175,7 +175,7 @@ utils.getAddress = function(item, network) { return; } address.network = network; - return address.toString(); + return address.toString(network); }; module.exports = utils; diff --git a/package.json b/package.json index 4aad1394..b436023a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "node": ">=8.0.0" }, "author": "BitPay ", - "version": "5.0.3", + "version": "5.0.4", "main": "./index.js", "repository": "git://github.com/oipwg/flocore-node.git", "homepage": "https://github.com/oipwg/flocore-node",