Skip to content

Commit de153f5

Browse files
committed
Add RefundingV2 phase (for splicing)
1 parent cfc39d1 commit de153f5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,9 @@ pub(super) enum Channel<SP: Deref> where SP::Target: SignerProvider {
11311131
#[allow(dead_code)] // TODO(dual_funding): Remove once creating V2 channels is enabled.
11321132
UnfundedV2(PendingV2Channel<SP>),
11331133
Funded(FundedChannel<SP>),
1134+
#[cfg(splicing)]
1135+
/// Used during splicing, channel is funded but a new funding is being renegotiated.
1136+
RefundingV2(FundedChannel<SP>),
11341137
}
11351138

11361139
impl<SP: Deref> Channel<SP> where
@@ -1143,6 +1146,8 @@ impl<SP: Deref> Channel<SP> where
11431146
Channel::UnfundedOutboundV1(chan) => &chan.context,
11441147
Channel::UnfundedInboundV1(chan) => &chan.context,
11451148
Channel::UnfundedV2(chan) => &chan.context,
1149+
#[cfg(splicing)]
1150+
Channel::RefundingV2(chan) => &chan.context,
11461151
}
11471152
}
11481153

@@ -1152,6 +1157,8 @@ impl<SP: Deref> Channel<SP> where
11521157
Channel::UnfundedOutboundV1(ref mut chan) => &mut chan.context,
11531158
Channel::UnfundedInboundV1(ref mut chan) => &mut chan.context,
11541159
Channel::UnfundedV2(ref mut chan) => &mut chan.context,
1160+
#[cfg(splicing)]
1161+
Channel::RefundingV2(ref mut chan) => &mut chan.context,
11551162
}
11561163
}
11571164

@@ -1161,6 +1168,8 @@ impl<SP: Deref> Channel<SP> where
11611168
Channel::UnfundedOutboundV1(chan) => Some(&mut chan.unfunded_context),
11621169
Channel::UnfundedInboundV1(chan) => Some(&mut chan.unfunded_context),
11631170
Channel::UnfundedV2(chan) => Some(&mut chan.unfunded_context),
1171+
#[cfg(splicing)]
1172+
Channel::RefundingV2(_) => { debug_assert!(false); None },
11641173
}
11651174
}
11661175

@@ -1275,6 +1284,8 @@ impl<SP: Deref> Channel<SP> where
12751284
})
12761285
},
12771286
Channel::UnfundedV2(_) => None,
1287+
#[cfg(splicing)]
1288+
Channel::RefundingV2(chan) => Some(chan.signer_maybe_unblocked(logger)),
12781289
}
12791290
}
12801291

@@ -1284,6 +1295,8 @@ impl<SP: Deref> Channel<SP> where
12841295
Channel::UnfundedOutboundV1(chan) => chan.is_resumable(),
12851296
Channel::UnfundedInboundV1(_) => false,
12861297
Channel::UnfundedV2(_) => false,
1298+
#[cfg(splicing)]
1299+
Channel::RefundingV2(_) => false,
12871300
}
12881301
}
12891302

@@ -1321,6 +1334,8 @@ impl<SP: Deref> Channel<SP> where
13211334
debug_assert!(false);
13221335
None
13231336
},
1337+
#[cfg(splicing)]
1338+
Channel::RefundingV2(_) => None,
13241339
}
13251340
}
13261341

@@ -1353,6 +1368,8 @@ impl<SP: Deref> Channel<SP> where
13531368
debug_assert!(false);
13541369
Ok(None)
13551370
},
1371+
#[cfg(splicing)]
1372+
Channel::RefundingV2(_) => Ok(None),
13561373
}
13571374
}
13581375
}

0 commit comments

Comments
 (0)