From 9809cc2dfd391c8d76068743086b1aada502ece0 Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Fri, 30 Oct 2020 12:39:18 +0100 Subject: [PATCH] feeadjuster: fix typos --- feeadjuster/feeadjuster.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/feeadjuster/feeadjuster.py b/feeadjuster/feeadjuster.py index 9732556..e10b441 100755 --- a/feeadjuster/feeadjuster.py +++ b/feeadjuster/feeadjuster.py @@ -10,7 +10,7 @@ plugin.adj_balances = {} # Cache to avoid loads of calls to getinfo plugin.our_node_id = None # Users can configure this -plugin.update_treshold = 0.05 +plugin.update_threshold = 0.05 def get_ratio(our_percentage): @@ -30,12 +30,12 @@ def maybe_adjust_fees(plugin: Plugin, scids: list): # Only update on substantial balance moves to avoid flooding, and add # some pseudo-randomness to avoid too easy channel balance probing - update_treshold = plugin.update_treshold + update_threshold = plugin.update_threshold if not plugin.deactivate_fuzz: - update_treshold += random.uniform(-0.015, 0.015) + update_threshold += random.uniform(-0.015, 0.015) if (last_percentage is None - or abs(last_percentage - percentage) > update_treshold): + or abs(last_percentage - percentage) > update_threshold): ratio = get_ratio(percentage) try: plugin.rpc.setchannelfee(scid, int(plugin.adj_basefee * ratio), @@ -100,7 +100,7 @@ def forward_event(plugin: Plugin, forward_event: dict, **kwargs): def init(options: dict, configuration: dict, plugin: Plugin, **kwargs): plugin.our_node_id = plugin.rpc.getinfo()["id"] plugin.deactivate_fuzz = options.get("feeadjuster-deactivate-fuzz", False) - plugin.update_treshold = float(options.get("feeadjuster-threshold", "0.05")) + plugin.update_threshold = float(options.get("feeadjuster-threshold", "0.05")) config = plugin.rpc.listconfigs() plugin.adj_basefee = config["fee-base"] plugin.adj_ppmfee = config["fee-per-satoshi"] @@ -117,7 +117,7 @@ def init(options: dict, configuration: dict, plugin: Plugin, **kwargs): plugin.log("Plugin feeadjuster initialized ({} base / {} ppm) with a " "threshold of {}" .format(plugin.adj_basefee, plugin.adj_ppmfee, - plugin.update_treshold)) + plugin.update_threshold)) plugin.add_option( @@ -129,8 +129,8 @@ plugin.add_option( plugin.add_option( "feeadjuster-threshold", "0.05", - "Channel balance update threshold at which to trigger an update. Note " - "it's fuzzed.", + "Channel balance update threshold at which to trigger an update. " + "Note: it's also fuzzed by 1.5%", "string" ) plugin.run()