| | |
| | | if(blocnNum==null){ |
| | | return; |
| | | } |
| | | System.out.println(TRC_BLOCK); |
| | | redisUtils.set("USDT_TRC20_CURRENT_BLOCK_NUM",blocnNum); |
| | | System.out.println("扫块:"+blocnNum); |
| | | trxUsdtUpdateService.monitorCoinListener(blocnNum); |
| | | } |
| | | |
| | | @Scheduled(cron = "0/2 * * * * ? ") |
| | | public void usdtTc20UpdateQueue() { |
| | | // 当前时间戳 |
| | | long currentTimeMillis = System.currentTimeMillis()/1000; |
| | | // 计算当前最新区块 |
| | | // 波场3秒出一个块 根据创世区块的时间可以计算出当前最新区块号 |
| | | Long count = (currentTimeMillis-TRX_CSQK)/3; |
| | | // 减去未确认的区块 |
| | | long getnowblock =count-25; |
| | | // 查询最新区块号 |
| | | long getnowblock =trxUsdtUpdateService.getnowblockFromTronScan()-25; |
| | | System.out.println("getnowblock:"+getnowblock); |
| | | // 生成块到队列 |
| | | Object trc20BlockNum = redisUtils.get("USDT_TRC20_BLOCK_NUM"); |
| | | if(trc20BlockNum==null){ |
| | |
| | | blockCoinService.updateXrp(); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // 当前时间戳 |
| | | long currentTimeMillis = System.currentTimeMillis()/1000; |
| | | // 计算当前最新区块 |
| | | // 波场3秒出一个块 根据创世区块的时间可以计算出当前最新区块号 |
| | | Long count = (currentTimeMillis-TRX_CSQK)/3; |
| | | // 减去未确认的区块 |
| | | long getnowblock =count-25; |
| | | System.out.println(count); |
| | | } |
| | | } |