From 86e0008469f9c8c02bebfd708826e60f80033052 Mon Sep 17 00:00:00 2001 From: Carlos Tosta Date: Thu, 10 Jun 2021 19:09:32 -0300 Subject: [PATCH 1/2] Support for regtest network addresses in route-utils.js file --- src/util/route-utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/route-utils.js b/src/util/route-utils.js index ce5b60f..f4b4afc 100644 --- a/src/util/route-utils.js +++ b/src/util/route-utils.js @@ -83,6 +83,10 @@ class RouteUtils { const addrIsMain = this.bchjs.Address.isMainnetAddress(cashAddr) if (network === 'mainnet' && addrIsMain) return true + // Return true if the network and address both match regtest + const addrIsMain = this.bchjs.Address.isRegTestAddress(cashAddr) + if (network === 'regtest' && addrIsMain) return true + return false } catch (err) { wlogger.error('Error in validateNetwork()') From bfaaab5b918b38c60af0798f074f4df404f533d2 Mon Sep 17 00:00:00 2001 From: Carlos Tosta Date: Thu, 10 Jun 2021 19:19:11 -0300 Subject: [PATCH 2/2] regtest const name change --- src/util/route-utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/route-utils.js b/src/util/route-utils.js index f4b4afc..75379d5 100644 --- a/src/util/route-utils.js +++ b/src/util/route-utils.js @@ -84,8 +84,8 @@ class RouteUtils { if (network === 'mainnet' && addrIsMain) return true // Return true if the network and address both match regtest - const addrIsMain = this.bchjs.Address.isRegTestAddress(cashAddr) - if (network === 'regtest' && addrIsMain) return true + const addrIsRegtest = this.bchjs.Address.isRegTestAddress(cashAddr) + if (network === 'regtest' && addrIsRegtest) return true return false } catch (err) {