lnpeer: replace assert active_forwarding with if. force both incoming and outgoing MPP in test_mpp_consolidation
This commit is contained in:
@@ -2801,8 +2801,8 @@ class Peer(Logger, EventListener):
|
||||
self.lnworker.active_forwardings[payment_key].append(next_htlc)
|
||||
self.lnworker.downstream_to_upstream_htlc[next_htlc] = htlc_key
|
||||
except OnionRoutingFailure as e:
|
||||
assert len(self.lnworker.active_forwardings[payment_key]) == 0
|
||||
self.lnworker.save_forwarding_failure(payment_key, failure_message=e)
|
||||
if len(self.lnworker.active_forwardings[payment_key]) == 0:
|
||||
self.lnworker.save_forwarding_failure(payment_key, failure_message=e)
|
||||
# TODO what about other errors? e.g. TxBroadcastError for a swap.
|
||||
# - malicious electrum server could fake TxBroadcastError
|
||||
# Could we "catch-all Exception" and fail back the htlcs with e.g. TEMPORARY_NODE_FAILURE?
|
||||
|
||||
@@ -1950,7 +1950,8 @@ class TestPeerForwarding(TestPeer):
|
||||
graph = self.prepare_chans_and_peers_in_graph(graph_definition)
|
||||
if test_mpp_consolidation:
|
||||
graph.workers['dave'].features |= LnFeatures.BASIC_MPP_OPT
|
||||
graph.workers['alice'].network.config.TEST_FORCE_MPP = True
|
||||
graph.workers['alice'].network.config.TEST_FORCE_MPP = True # trampoline must wait until all incoming htlcs are received before sending outgoing htlcs
|
||||
graph.workers['bob'].network.config.TEST_FORCE_MPP = True # trampoline must wait until all outgoing htlcs have failed before failing incoming htlcs
|
||||
if is_legacy:
|
||||
# turn off trampoline features in invoice
|
||||
graph.workers['dave'].features = graph.workers['dave'].features ^ LnFeatures.OPTION_TRAMPOLINE_ROUTING_OPT_ELECTRUM
|
||||
|
||||
Reference in New Issue
Block a user