diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index db2333f..4f2b388 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -479,10 +479,8 @@ class BasicSwap(BaseApp): } if coin in (Coins.FIRO, Coins.LTC): - self.coin_clients[coin]['min_relay_fee'] = 0.00001 - - if chain_client_settings.get('min_relay_fee', None): - self.coin_clients[coin]['min_relay_fee'] = chain_client_settings['min_relay_fee'] + if not chain_client_settings.get('min_relay_fee'): + chain_client_settings['min_relay_fee'] = 0.00001 if coin == Coins.PART: self.coin_clients[coin]['anon_tx_ring_size'] = chain_client_settings.get('anon_tx_ring_size', 12) diff --git a/basicswap/interface/btc.py b/basicswap/interface/btc.py index e21109c..676231d 100644 --- a/basicswap/interface/btc.py +++ b/basicswap/interface/btc.py @@ -378,7 +378,7 @@ class BTCInterface(CoinInterface): ensure(addr_info['hdseedid'] == self._expect_seedid_hex, 'unexpected seedid') def get_fee_rate(self, conf_target: int = 2) -> (float, str): - chain_client_settings = self._sc.getChainClientSettings(self.coin_type()) + chain_client_settings = self._sc.getChainClientSettings(self.coin_type()) # basicswap.json override_feerate = chain_client_settings.get('override_feerate', None) if override_feerate: self._log.debug('Fee rate override used for %s: %f', self.coin_name(), override_feerate) @@ -388,19 +388,21 @@ class BTCInterface(CoinInterface): def try_get_fee_rate(self, conf_target): try: - fee_rate = self.rpc_wallet('estimatesmartfee', [conf_target])['feerate'] - assert (fee_rate > 0.0), 'Non positive feerate' + fee_rate: float = self.rpc_wallet('estimatesmartfee', [conf_target])['feerate'] + assert (fee_rate > 0.0), 'Negative feerate' return fee_rate, 'estimatesmartfee' except Exception: try: - fee_rate = self.rpc_wallet('getwalletinfo')['paytxfee'] + fee_rate: float = self.rpc_wallet('getwalletinfo')['paytxfee'] assert (fee_rate > 0.0), 'Non positive feerate' return fee_rate, 'paytxfee' except Exception: - return self.rpc('getnetworkinfo')['relayfee'], 'relayfee' + fee_rate: float = self.rpc('getnetworkinfo')['relayfee'] + return fee_rate, 'relayfee' fee_rate, rate_src = try_get_fee_rate(self, conf_target) if min_relay_fee and min_relay_fee > fee_rate: + self._log.warning('Feerate {} ({}) is below min relay fee {} for {}'.format(self.format_amount(fee_rate, True, 1), rate_src, self.format_amount(min_relay_fee, True, 1), self.coin_name())) return min_relay_fee, 'min_relay_fee' return fee_rate, rate_src diff --git a/basicswap/interface/xmr.py b/basicswap/interface/xmr.py index 159f9c1..7856c88 100644 --- a/basicswap/interface/xmr.py +++ b/basicswap/interface/xmr.py @@ -222,7 +222,7 @@ class XMRInterface(CoinInterface): return new_address def get_fee_rate(self, conf_target: int = 2): - self._log.warning('TODO - estimate fee rate?') + self._log.warning('TODO - estimate XMR fee rate?') return 0.0, 'unused' def getNewSecretKey(self) -> bytes: