Skip to content

Commit a9ef7b2

Browse files
committed
Move Channel fields into ChannelContext struct
This is a first step for simplifying the channel state and introducing new unfunded channel types that hold similar state before being promoted to funded channels. Essentially, we want the outer `Channel` type (and upcoming channel types) to wrap the context so we can apply typestate patterns to the that wrapper while also deduplicating code for common state and other internal fields.
1 parent 3d479c9 commit a9ef7b2

File tree

5 files changed

+1305
-1283
lines changed

5 files changed

+1305
-1283
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,12 +1427,12 @@ fn monitor_failed_no_reestablish_response() {
14271427
{
14281428
let mut node_0_per_peer_lock;
14291429
let mut node_0_peer_state_lock;
1430-
get_channel_ref!(nodes[0], nodes[1], node_0_per_peer_lock, node_0_peer_state_lock, channel_id).announcement_sigs_state = AnnouncementSigsState::PeerReceived;
1430+
get_channel_ref!(nodes[0], nodes[1], node_0_per_peer_lock, node_0_peer_state_lock, channel_id).context.announcement_sigs_state = AnnouncementSigsState::PeerReceived;
14311431
}
14321432
{
14331433
let mut node_1_per_peer_lock;
14341434
let mut node_1_peer_state_lock;
1435-
get_channel_ref!(nodes[1], nodes[0], node_1_per_peer_lock, node_1_peer_state_lock, channel_id).announcement_sigs_state = AnnouncementSigsState::PeerReceived;
1435+
get_channel_ref!(nodes[1], nodes[0], node_1_per_peer_lock, node_1_peer_state_lock, channel_id).context.announcement_sigs_state = AnnouncementSigsState::PeerReceived;
14361436
}
14371437

14381438
// Route the payment and deliver the initial commitment_signed (with a monitor update failure

0 commit comments

Comments
 (0)