|
|
@@ -370,10 +370,9 @@ class ArbitrageProcess:
|
|
|
self.tx['nonce'] = self.core_data['nonce']
|
|
|
|
|
|
# 调用链上客户端执行买入交易
|
|
|
- self.chain_tx_hash = web3._sign_and_send_transaction(
|
|
|
- self.tx,
|
|
|
- self.gas_limit_multiplier
|
|
|
- )
|
|
|
+ signed_tx = web3._sign(self.tx, self.gas_limit_multiplier)
|
|
|
+ self.chain_tx_hash = web3.w3.to_hex(signed_tx.hash)
|
|
|
+ web3.w3.eth.send_raw_transaction(signed_tx.raw_transaction)
|
|
|
|
|
|
# 交易成功后刷新全局nonce
|
|
|
with self.core_lock:
|
|
|
@@ -392,12 +391,11 @@ class ArbitrageProcess:
|
|
|
logger.info(msg)
|
|
|
add_state_flow_entry(self.process_item, self.current_state, msg, "success")
|
|
|
self._set_state(self.STATE_WAITING_CHAIN_CONFIRM)
|
|
|
-
|
|
|
except Exception as e:
|
|
|
- msg = f"链上买入失败:{e}"
|
|
|
+ msg = f"据反饋說链上买入失败:{e}, 交易哈希:{self.chain_tx_hash}"
|
|
|
logger.error(msg)
|
|
|
add_state_flow_entry(self.process_item, self.current_state, msg, "fail")
|
|
|
- self._set_state(self.STATE_WAITING_EXCHANGE_ROLLBACK)
|
|
|
+ self._set_state(self.STATE_WAITING_CHAIN_CONFIRM)
|
|
|
|
|
|
traceback.print_exc()
|
|
|
|