소스 검색

fix 并发出金失败的bug

DevYK 3 년 전
부모
커밋
34823a9a6c
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      routes/sdk.js

+ 4 - 1
routes/sdk.js

@@ -128,7 +128,6 @@ async function withdraw_task() {
         if (utils.getTimestamp() - last_time < 60000) {
             //有可能上一个区块还未更新,这里做一个尝试限制
             //Error: Failed to make "eth_sendRawTransaction" request with networkConnector: "already known"
-            logger.error('sleep5s', last_receiver);
             //通过 交易 hash 获取块。last_hash
             if (last_hash) {
                 var options = {
@@ -193,6 +192,10 @@ async function withdraw_task() {
                 await withdraw_db.update_withdraw_task(exec_obj.withdraw_id, update_obj)
             }
         } catch (error) {
+            var update_obj = {}
+            update_obj.withdraw_status = 3
+            update_obj.errorMsg = error.toString()
+            await withdraw_db.update_withdraw_task(exec_obj.withdraw_id, update_obj)
             logger.error('withdraw_task error=', error)
         }
     }