Define minimum gas cost
For networks where the gas price is zero. Since we determine when
to pay based on debt and gas prices it causes transactions to be
sent too quickly.
@@ -192,11 +192,13 @@ fn update_gas_price(web3: &Web3) {
trace!("Got response from gas price request {:?}", value);
// Dynamic fee computation
let mut payment_settings = SETTING.get_payment_mut();
- if value > 0u16.into() {
- payment_settings.gas_price = value;
- } else {
+ let minimum_gas_price: Uint256 = 250_000_000_000u128.into();
+ if value < minimum_gas_price {
// minimum gas price, for xdai where gas is free
- payment_settings.gas_price = 1_000_000u128.into();
+ // since we use gas to adjust the payment limit
+ payment_settings.gas_price = minimum_gas_price;
+ } else {
+ payment_settings.gas_price = value;
}
let dynamic_fee_factor: Int256 = payment_settings.dynamic_fee_multiplier.into();
