1
0

set initial trampoline fee level to 1 unless we are testing

This commit is contained in:
ThomasV
2021-03-22 17:03:50 +01:00
parent c3221f7bfe
commit f7d2a33d45
2 changed files with 4 additions and 1 deletions

View File

@@ -185,6 +185,8 @@ LNGOSSIP_FEATURES = BASE_FEATURES\
class LNWorker(Logger, 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__(
@@ -1150,7 +1152,7 @@ class LNWallet(LNWorker):
raise OnionRoutingFailure(code=OnionFailureCode.TRAMPOLINE_EXPIRY_TOO_SOON, data=b'')
self.logs[payment_hash.hex()] = log = []
trampoline_fee_level = 0 # only used for trampoline payments
trampoline_fee_level = self.INITIAL_TRAMPOLINE_FEE_LEVEL
use_two_trampolines = True # only used for pay to legacy
amount_inflight = 0 # what we sent in htlcs (that receiver gets, without fees)

View File

@@ -116,6 +116,7 @@ class MockWallet:
class MockLNWallet(Logger, NetworkRetryManager[LNPeerAddr]):
MPP_EXPIRY = 2 # HTLC timestamps are cast to int, so this cannot be 1
TIMEOUT_SHUTDOWN_FAIL_PENDING_HTLCS = 0
INITIAL_TRAMPOLINE_FEE_LEVEL = 0
def __init__(self, *, local_keypair: Keypair, chans: Iterable['Channel'], tx_queue, name):
self.name = name