Browse Source

move INITIAL_TRAMPOLINE_FEE_LEVEL to config

master
ThomasV 2 years ago
parent
commit
4e76ed6952
  1. 4
      electrum/lnworker.py
  2. 1
      electrum/simple_config.py
  3. 2
      electrum/tests/test_lnpeer.py

4
electrum/lnworker.py

@ -233,8 +233,6 @@ LNGOSSIP_FEATURES = (
class LNWorker(Logger, EventListener, NetworkRetryManager[LNPeerAddr]):
INITIAL_TRAMPOLINE_FEE_LEVEL = 1 # only used for trampoline payments. set to 0 in tests.
def __init__(self, xprv, features: LnFeatures):
Logger.__init__(self)
NetworkRetryManager.__init__(
@ -1456,7 +1454,7 @@ class LNWallet(LNWorker):
self._paysessions[payment_key] = paysession = PaySession(
payment_hash=payment_hash,
payment_secret=payment_secret,
initial_trampoline_fee_level=self.INITIAL_TRAMPOLINE_FEE_LEVEL,
initial_trampoline_fee_level=self.config.INITIAL_TRAMPOLINE_FEE_LEVEL,
invoice_features=invoice_features,
r_tags=r_tags,
min_cltv_expiry=min_cltv_expiry,

1
electrum/simple_config.py

@ -979,6 +979,7 @@ Note you are at risk of losing the funds in the swap, if the funding transaction
This will result in longer routes; it might increase your fees and decrease the success rate of your payments."""),
)
INITIAL_TRAMPOLINE_FEE_LEVEL = ConfigVar('initial_trampoline_fee_level', default=1, type_=int)
EXPERIMENTAL_LN_FORWARD_PAYMENTS = ConfigVar('lightning_forward_payments', default=False, type_=bool)
EXPERIMENTAL_LN_FORWARD_TRAMPOLINE_PAYMENTS = ConfigVar('lightning_forward_trampoline_payments', default=False, type_=bool)

2
electrum/tests/test_lnpeer.py

@ -131,7 +131,6 @@ class MockLNWallet(Logger, EventListener, NetworkRetryManager[LNPeerAddr]):
MPP_EXPIRY = 2 # HTLC timestamps are cast to int, so this cannot be 1
PAYMENT_TIMEOUT = 120
TIMEOUT_SHUTDOWN_FAIL_PENDING_HTLCS = 0
INITIAL_TRAMPOLINE_FEE_LEVEL = 0
MPP_SPLIT_PART_FRACTION = 1 # this disables the forced splitting
MPP_SPLIT_PART_MINAMT_MSAT = 5_000_000
@ -178,6 +177,7 @@ class MockLNWallet(Logger, EventListener, NetworkRetryManager[LNPeerAddr]):
self.downstream_htlc_to_upstream_peer_map = {}
self.hold_invoice_callbacks = {}
self.payment_bundles = [] # lists of hashes. todo:persist
self.config.INITIAL_TRAMPOLINE_FEE_LEVEL = 0
self.logger.info(f"created LNWallet[{name}] with nodeID={local_keypair.pubkey.hex()}")

Loading…
Cancel
Save