Prechádzať zdrojové kódy

fix 线上and test 环境归集失败的问题

DevYK 3 rokov pred
rodič
commit
baf321e467
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      model/moralis_sdk.js

+ 3 - 3
model/moralis_sdk.js

@@ -344,7 +344,7 @@ function reduceNativeValue(nativeValue, rValue) {
 async function updateNativeBalance(nativeBalance, obj) {
     var temp = { ...obj }
     console.log('updateNativeBalance before', temp, nativeBalance)
-    var retryCount = 30;
+    var retryCount = 15;
     if (temp.chain) {
         temp.chain = utils.getChainName(temp.chain)
     }
@@ -352,8 +352,8 @@ async function updateNativeBalance(nativeBalance, obj) {
     do {
         //上面转账完 BNB 会减去,这里再获取一次
         var native_ret = await Moralis.Web3API.account.getNativeBalance(temp);
-        logger.log('更新余额 :', native_ret, native_ret,retryCount)
-        if (nativeBalance != native_ret.balance) {
+        logger.log('更新余额 :', nativeBalance, native_ret, retryCount)
+        if (nativeBalance != native_ret.balance && BigInt(nativeBalance) < BigInt(native_ret.balance)) {
             return native_ret.balance;
         }
         await utils.sleep(3000);