@@ -235,21 +235,23 @@ def build_transaction(
235235 )
236236 if "max fee per gas less than block base fee" in str (e ):
237237 try :
238- return self ._build_transaction (e , tkn , nonce )
238+ return self ._build_transaction (e , max_priority_gas , tkn , nonce )
239239 except Exception as e :
240240 self .mgr .cfg .logger .debug (
241241 f"(***2***) Error when building transaction: { e .__class__ .__name__ } { e } "
242242 )
243243 return None
244244
245- def _build_transaction (self , e : Exception , tkn : str , nonce : int ):
245+ def _build_transaction (self , e : Exception , max_priority : int , tkn : str , nonce : int ):
246246 """
247247 Handles the transaction generation logic.
248248
249249 Parameters
250250 ----------
251251 e: Exception
252252 The exception
253+ max_priority: int
254+ The max priority fee input
253255 tkn: str
254256 The token address
255257 nonce: int
@@ -265,15 +267,12 @@ def _build_transaction(self, e: Exception, tkn: str, nonce: int):
265267 split1 = message .split ("maxFeePerGas: " )[1 ]
266268 split2 = split1 .split (" baseFee: " )
267269 split_base_fee = int (split2 [1 ].split (" (supplied gas" )[0 ])
268- split_max_priority_fee_per_gas = int (
269- int (split2 [0 ]) * self .mgr .cfg .DEFAULT_GAS_PRICE_OFFSET
270- )
271270 return self .bancor_network_contract .functions .withdrawPOL (
272271 self .mgr .web3 .to_checksum_address (tkn )
273272 ).build_transaction (
274273 self .tx_helpers .build_tx (
275274 base_gas_price = split_base_fee ,
276- max_priority_fee = split_max_priority_fee_per_gas ,
275+ max_priority_fee = max_priority ,
277276 nonce = nonce ,
278277 )
279278 )
0 commit comments