You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regenerate PendingHTLCsForwardable on reload instead of serializing
When we are prepared to forward HTLCs, we generate a
PendingHTLCsForwardable event with a time in the future when the
user should tell us to forward. This provides some basic batching
of forward events, improving privacy slightly.
After we generate the event, we expect users to spawn a timer in
the background and let us know when it finishes. However, if the
user shuts down before the timer fires, the user will restart and
have no idea that HTLCs are waiting to be forwarded/received.
To fix this, instead of serializing PendingHTLCsForwardable events
to disk while they're pending (before the user starts the timer),
we simply regenerate them when a ChannelManager is deserialized
with HTLCs pending.
Fixes#1042
// Tests that if we reload a ChannelManager while forwards are pending we will regenerate the
9020
+
// PendingHTLCsForwardable event automatically, ensuring we don't forget to forward/receive
9021
+
// HTLCs.
9022
+
// We test it for both payment receipt and payment forwarding.
9023
+
9024
+
let chanmon_cfgs = create_chanmon_cfgs(3);
9025
+
let node_cfgs = create_node_cfgs(3,&chanmon_cfgs);
9026
+
let node_chanmgrs = create_node_chanmgrs(3,&node_cfgs,&[None,None,None]);
9027
+
let persister: test_utils::TestPersister;
9028
+
let new_chain_monitor: test_utils::TestChainMonitor;
9029
+
let nodes_1_deserialized:ChannelManager<EnforcingSigner,&test_utils::TestChainMonitor,&test_utils::TestBroadcaster,&test_utils::TestKeysInterface,&test_utils::TestFeeEstimator,&test_utils::TestLogger>;
0 commit comments