mirror of
https://github.com/basicswap/basicswap.git
synced 2024-11-16 15:58:17 +00:00
Always use csv with adaptor sig swaps.
This commit is contained in:
parent
c387bfec71
commit
ce578f8025
3 changed files with 8 additions and 4 deletions
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 = {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue