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
Handle async initial ChannelMonitor persistence failing on restart
If the initial ChannelMonitor persistence is done asynchronously
but does not complete before the node restarts (with a
ChannelManager persistence), we'll start back up with a channel
present but no corresponding ChannelMonitor.
Because the Channel is pending-monitor-update and has not yet
broadcasted its initial funding transaction, this is not a
violation of our API contract nor a safety violation. However, the
previous code would refuse to deserialize the ChannelManager
treating it as an API contract violation.
The solution is to test for this case explicitly and drop the
channel entirely as if the peer disconnected before we received
the funding_signed.
// Test that if the monitor update generated by funding_transaction_generated is stored async
2752
+
// and we restart with the latest ChannelManager but the ChannelMonitor persistence never
2753
+
// completed we happily drop the channel and move on.
2754
+
let chanmon_cfgs = create_chanmon_cfgs(2);
2755
+
let node_cfgs = create_node_cfgs(2,&chanmon_cfgs);
2756
+
2757
+
let persister: test_utils::TestPersister;
2758
+
let new_chain_monitor: test_utils::TestChainMonitor;
2759
+
let nodes_0_deserialized:ChannelManager<EnforcingSigner,&test_utils::TestChainMonitor,&test_utils::TestBroadcaster,&test_utils::TestKeysInterface,&test_utils::TestFeeEstimator,&test_utils::TestLogger>;
0 commit comments