From 543a820a1207547de252f3db2adafc570497e9ae Mon Sep 17 00:00:00 2001 From: nahuhh <50635951+nahuhh@users.noreply.github.com> Date: Sat, 5 Jul 2025 02:41:20 +0000 Subject: [PATCH] AMM: bug fixes - skip offer if amount field missing - write amount line if missing - set minrate to 0 if missing or null --- scripts/createoffers.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/createoffers.py b/scripts/createoffers.py index 5cd729e..2ffdc7d 100755 --- a/scripts/createoffers.py +++ b/scripts/createoffers.py @@ -329,8 +329,10 @@ def readConfig(args, known_coins): elif offer_template["enabled"] is not True: continue if "amount" not in offer_template: - offer_template["amount"] = None - print(f"{offer_template['name']} amount missing. Skipping offer") + offer_template["amount"] = 0 + print(f"{offer_template['name']} Offer amount missing. Skipping offer") + num_changes += 1 + continue elif ( offer_template["amount"] is None or float(offer_template["amount"]) < min_swap_size @@ -338,6 +340,10 @@ def readConfig(args, known_coins): print(f"{offer_template['name']} Offer amount invalid. Skipping offer") continue amount = float(offer_template["amount"]) + if "minrate" not in offer_template or offer_template["minrate"] is None: + offer_template["minrate"] = 0 + print(f"{offer_template['name']} Offer minrate missing. Setting to 0") + num_changes += 1 if "amount_step" not in offer_template: print( f"Adding mandatory amount_step for {offer_template['name']} (privacy feature)"