Set default swap type to ADS if coin_from or to is scriptless.

This commit is contained in:
tecnovert 2024-10-27 23:38:36 +02:00
parent e23216df07
commit 3345d56f5b
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93

View file

@ -161,7 +161,7 @@ def parseOfferFormData(swap_client, form_data, page_data, options={}):
page_data['swap_type'] = get_data_entry(form_data, 'swap_type')
parsed_data['swap_type'] = page_data['swap_type']
swap_type = swap_type_from_string(parsed_data['swap_type'])
elif parsed_data['coin_to'] in (Coins.XMR, Coins.WOW, Coins.PART_ANON):
elif parsed_data['coin_from'] in swap_client.scriptless_coins or parsed_data['coin_to'] in swap_client.scriptless_coins:
parsed_data['swap_type'] = strSwapType(SwapTypes.XMR_SWAP)
swap_type = SwapTypes.XMR_SWAP
else:
@ -267,7 +267,7 @@ def postNewOfferFromParsed(swap_client, parsed_data):
if 'swap_type' in parsed_data:
str_swap_type = parsed_data['swap_type'].lower()
swap_type = swap_type_from_string(str_swap_type)
elif parsed_data['coin_to'] in (Coins.XMR, Coins.WOW, Coins.PART_ANON):
elif parsed_data['coin_from'] in swap_client.scriptless_coins or parsed_data['coin_to'] in swap_client.scriptless_coins:
swap_type = SwapTypes.XMR_SWAP
if swap_type == SwapTypes.XMR_SWAP: