Load in-progress bids only when unlocked.

This commit is contained in:
tecnovert
2023-02-16 22:57:55 +02:00
parent 3234e3fba3
commit 2922b171a6
11 changed files with 276 additions and 89 deletions

View File

@@ -684,7 +684,7 @@ class PARTInterfaceBlind(PARTInterface):
return -1
return None
def spendBLockTx(self, chain_b_lock_txid, address_to, kbv, kbs, cb_swap_value, b_fee, restore_height, spend_actual_balance=False):
def spendBLockTx(self, chain_b_lock_txid: bytes, address_to: str, kbv: bytes, kbs: bytes, cb_swap_value: int, b_fee: int, restore_height: int, spend_actual_balance: bool = False) -> bytes:
Kbv = self.getPubkey(kbv)
Kbs = self.getPubkey(kbs)
sx_addr = self.formatStealthAddress(Kbv, Kbs)
@@ -813,7 +813,7 @@ class PARTInterfaceAnon(PARTInterface):
return -1
return None
def spendBLockTx(self, chain_b_lock_txid, address_to, kbv, kbs, cb_swap_value, b_fee, restore_height, spend_actual_balance=False):
def spendBLockTx(self, chain_b_lock_txid: bytes, address_to: str, kbv: bytes, kbs: bytes, cb_swap_value: int, b_fee: int, restore_height: int, spend_actual_balance: bool = False) -> bytes:
Kbv = self.getPubkey(kbv)
Kbs = self.getPubkey(kbs)
sx_addr = self.formatStealthAddress(Kbv, Kbs)

View File

@@ -417,7 +417,7 @@ class XMRInterface(CoinInterface):
return bytes.fromhex(rv['tx_hash_list'][0])
def withdrawCoin(self, value, addr_to, subfee):
def withdrawCoin(self, value: int, addr_to: str, subfee: bool) -> str:
with self._mx_wallet:
value_sats = make_int(value, self.exp())
@@ -427,7 +427,7 @@ class XMRInterface(CoinInterface):
if subfee:
balance = self.rpc_wallet_cb('get_balance')
diff = balance['unlocked_balance'] - value_sats
if diff > 0 and diff <= 10:
if diff >= 0 and diff <= 10:
self._log.info('subfee enabled and value close to total, using sweep_all.')
params = {'address': addr_to}
if self._fee_priority > 0: