|
@@ -13,6 +13,7 @@ const report = require("./report") //导入 db.js
|
|
|
const BigNumber = require('bignumber.js')
|
|
|
const collect_coins_db = require('./db/collect_coins_db')
|
|
|
const czz = require('./czz')
|
|
|
+var remote_config_db = require("../model/db/remote_config_db");
|
|
|
|
|
|
/* Moralis init code */
|
|
|
var serverUrl = moralis_config.SERVER_URL;
|
|
@@ -78,7 +79,7 @@ async function setWeb3apiRateLimit() {
|
|
|
if (!ret)
|
|
|
logger.error('setWeb3apiRateLimit error')
|
|
|
} catch (error) {
|
|
|
- logger.error('setWeb3apiRateLimit error',error.toString())
|
|
|
+ logger.error('setWeb3apiRateLimit error', error.toString())
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -740,6 +741,23 @@ async function queryCollectBalance(address, chain) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+async function filterTokenCollectCoins(obj, my_account_all_coins) {
|
|
|
+ if (my_account_all_coins.other && Array.isArray(my_account_all_coins.other) && my_account_all_coins.other.length > 0) {
|
|
|
+ logger.info('oldothers', my_account_all_coins.other)
|
|
|
+ var new_others = []
|
|
|
+ for (let index = 0; index < my_account_all_coins.other.length; index++) {
|
|
|
+ const element = my_account_all_coins.other[index];
|
|
|
+ var exist = await remote_config_db.tokenCollectCoinsBlacklistExist('token_collect', obj.chain, element.token_address)
|
|
|
+ if (exist) {
|
|
|
+ logger.error('token归集黑名单', obj.address, JSON.stringify(element))
|
|
|
+ } else {
|
|
|
+ new_others.push(element)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ my_account_all_coins.other = new_others
|
|
|
+ logger.info('newothers', my_account_all_coins.other)
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 用户充币地址的币转移到归集地址
|
|
@@ -766,6 +784,14 @@ const collectCoins = async (obj) => {
|
|
|
return 'getAccountAllCoins error.' + my_account_all_coins
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ try {
|
|
|
+ await filterTokenCollectCoins(obj, my_account_all_coins)
|
|
|
+ } catch (error) {
|
|
|
+ logger.error('filterTokenCollectCoins error',error.toString())
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//埋点日志-转账之前的充币地址余额
|
|
|
logParams.addressBalances = { ...my_account_all_coins };
|
|
|
|