|
@@ -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);
|