Merge pull request #71 from Permissionless-Software-Foundation/ct-unstable

fix(tokenUtxoDetails): Fixing bug with fallback validators
This commit is contained in:
Chris Troutner
2020-12-13 06:25:10 -08:00
committed by GitHub
+7
View File
@@ -1294,11 +1294,14 @@ class Utils {
// If not in the cache, try the general SLPDB.
if (isValid == null) {
isValid = await this.validateTxid(utxo.txid)
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)}`)
// If still null, check the whitelist SLPDB
@@ -1334,12 +1337,14 @@ class Utils {
// )}`
// )
if (isValid !== null) {
isValid = isValid[0].valid
// Save the result to the local cache.
cachedTxValidation[utxo.txid] = isValid
}
}
}
// If still null, as a last resort, check it against slp-validate
if (isValid === null) {
@@ -1348,11 +1353,13 @@ class Utils {
// `slp-validate isValid: ${JSON.stringify(isValid, null, 2)}`
// )
if (isValid !== null) {
isValid = isValid.isValid
// Save the result to the local cache.
cachedTxValidation[utxo.txid] = isValid
}
}
// console.log(`isValid: ${JSON.stringify(isValid, null, 2)}`)
outAry[i].isValid = isValid