From 6de2b712ece95cf19db077690346aba8f43a778a Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 12 Aug 2021 09:14:29 -0700 Subject: [PATCH] fix(minimal-slp-wallet): Fixed code that was breaking minimal-slp-wallet build --- src/slp/utils.js | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/slp/utils.js b/src/slp/utils.js index 3246ed5..55fd0dc 100644 --- a/src/slp/utils.js +++ b/src/slp/utils.js @@ -1588,31 +1588,25 @@ class Utils { // Note: validateTxid3() has the same output as validateTxid(). // validateTxid2() uses slp-validate, which has a different output format. - // If the whitelist SLPDB is having issues, the try/catch will skip it - // and continue execution. - try { - // Validate against the whitelist SLPDB first. - const whitelistResult = await this.validateTxid3(txid, usrObj) - // console.log( - // `whitelist-SLPDB for ${txid}: ${JSON.stringify( - // whitelistResult, - // null, - // 2 - // )}` - // ) + // Validate against the whitelist SLPDB first. + const whitelistResult = await this.validateTxid3(txid, usrObj) + // console.log( + // `whitelist-SLPDB for ${txid}: ${JSON.stringify( + // whitelistResult, + // null, + // 2 + // )}` + // ) - // Safely retrieve the returned value. - if (whitelistResult[0] !== null) isValid = whitelistResult[0].valid + // Safely retrieve the returned value. + if (whitelistResult[0] !== null) isValid = whitelistResult[0].valid - // Exit if isValid is not null. - if (isValid !== null) { - // Save to the cache. - cachedTxValidation[txid] = isValid + // Exit if isValid is not null. + if (isValid !== null) { + // Save to the cache. + cachedTxValidation[txid] = isValid - return isValid - } - } catch { - /* exit quietly */ + return isValid } // Try the general SLPDB, if the whitelist returned null.