Always use csv with adaptor sig swaps.

This commit is contained in:
tecnovert 2023-11-30 18:16:24 +02:00
parent c387bfec71
commit ce578f8025
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
3 changed files with 8 additions and 4 deletions

View file

@ -4706,7 +4706,7 @@ class BasicSwap(BaseApp):
bid_id = bid_accept_data.bid_msg_id
bid, offer = self.getBidAndOffer(bid_id)
ensure(bid is not None and bid.was_sent is True, 'Unknown bidid')
ensure(bid is not None and bid.was_sent is True, 'Unknown bid_id')
ensure(offer, 'Offer not found ' + bid.offer_id.hex())
ensure(bid.expire_at > now + self._bid_expired_leeway, 'Bid expired')

View file

@ -1388,7 +1388,7 @@ class BTCInterface(CoinInterface):
num_utxos = len(msg_utxos) // 34
p: int = 0
for i in range(num_utxos):
proof_utxos.append((msg_utxos[p: p + 32], int.from_bytes(msg_utxos[p + 32: p + 34])))
proof_utxos.append((msg_utxos[p: p + 32], int.from_bytes(msg_utxos[p + 32: p + 34], 'big')))
p += 34
return proof_utxos

View file

@ -261,10 +261,14 @@ def postNewOfferFromParsed(swap_client, parsed_data):
elif parsed_data['coin_to'] in (Coins.XMR, Coins.PART_ANON):
swap_type = SwapTypes.XMR_SWAP
if swap_client.coin_clients[parsed_data['coin_from']]['use_csv'] and swap_client.coin_clients[parsed_data['coin_to']]['use_csv']:
if swap_type == SwapTypes.XMR_SWAP:
# All coins capable of segwit should be capable of csv
lock_type = TxLockTypes.SEQUENCE_LOCK_TIME
else:
lock_type = TxLockTypes.ABS_LOCK_TIME
if swap_client.coin_clients[parsed_data['coin_from']]['use_csv'] and swap_client.coin_clients[parsed_data['coin_to']]['use_csv']:
lock_type = TxLockTypes.SEQUENCE_LOCK_TIME
else:
lock_type = TxLockTypes.ABS_LOCK_TIME
extra_options = {}