mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
Merge pull request #71 from Permissionless-Software-Foundation/ct-unstable
fix(tokenUtxoDetails): Fixing bug with fallback validators
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user