From 936b9e2a4a25aa570a0f4ddb07412d8912a71441 Mon Sep 17 00:00:00 2001 From: Interchained Date: Mon, 4 Jan 2021 16:36:43 -0500 Subject: [PATCH] allow backwards compatibility between coins configured with config.pubAddressPrefix, and coins without --- lib/utils.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index bf287e3..d9ba93c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -25,8 +25,7 @@ exports.instanceId = function () { * Validate miner address **/ var addressBase58 = parseInt(cnUtil.address_decode(new Buffer(config.poolAddress)).toString()); -var addressBase58Prefix = config.poolServer.pubAddressPrefix; -let addressBase58Prefix = parseInt(cnUtil.address_decode(Buffer.from(config.poolServer.poolAddress)).toString()); +var addressBase58Prefix = config.poolServer.pubAddressPrefix ? parseInt(config.poolServer.pubAddressPrefix) : parseInt(cnUtil.address_decode(Buffer.from(config.poolServer.poolAddress)).toString()); let integratedAddressBase58Prefix = config.poolServer.intAddressPrefix ? parseInt(config.poolServer.intAddressPrefix) : addressBase58Prefix + 1; let subAddressBase58Prefix = config.poolServer.subAddressPrefix ? parseInt(config.poolServer.subAddressPrefix) : "N/A";