From 12701cf3dcb9c1ce610649fb3a08622b36298733 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 13 Dec 2020 06:20:51 -0800 Subject: [PATCH] fix(tokenUtxoDetails): Fixing bug with fallback validators --- src/slp/utils.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/slp/utils.js b/src/slp/utils.js index 9f55d32..a8d533d 100644 --- a/src/slp/utils.js +++ b/src/slp/utils.js @@ -1294,10 +1294,13 @@ class Utils { // If not in the cache, try the general SLPDB. if (isValid == null) { isValid = await this.validateTxid(utxo.txid) - isValid = isValid[0].valid - // Save the result to the local cache. - cachedTxValidation[utxo.txid] = isValid + if (isValid !== null) { + isValid = isValid[0].valid + + // Save the result to the local cache. + cachedTxValidation[utxo.txid] = isValid + } } // console.log(`isValid: ${JSON.stringify(isValid, null, 2)}`) @@ -1334,10 +1337,12 @@ class Utils { // )}` // ) - isValid = isValid[0].valid + if (isValid !== null) { + isValid = isValid[0].valid - // Save the result to the local cache. - cachedTxValidation[utxo.txid] = isValid + // Save the result to the local cache. + cachedTxValidation[utxo.txid] = isValid + } } } @@ -1348,10 +1353,12 @@ class Utils { // `slp-validate isValid: ${JSON.stringify(isValid, null, 2)}` // ) - isValid = isValid.isValid + if (isValid !== null) { + isValid = isValid.isValid - // Save the result to the local cache. - cachedTxValidation[utxo.txid] = isValid + // Save the result to the local cache. + cachedTxValidation[utxo.txid] = isValid + } } // console.log(`isValid: ${JSON.stringify(isValid, null, 2)}`)