@@ -2860,31 +2860,6 @@ struct RefundingScope {
2860
2860
pending_interactive_tx_signing_session: Option<InteractiveTxSigningSession>,
2861
2861
}
2862
2862
2863
- #[cfg(splicing)]
2864
- impl RefundingScope {
2865
- /// Get a transaction input that is the previous funding transaction
2866
- fn get_input_of_previous_funding(pre_funding_transaction: &Option<Transaction>, pre_funding_txo: &Option<OutPoint>)
2867
- -> Result<(TxIn, TransactionU16LenLimited), ChannelError> {
2868
- if let Some(pre_funding_transaction) = pre_funding_transaction {
2869
- if let Some(pre_funding_txo) = pre_funding_txo {
2870
- Ok((
2871
- TxIn {
2872
- previous_output: pre_funding_txo.into_bitcoin_outpoint(),
2873
- script_sig: ScriptBuf::new(),
2874
- sequence: Sequence::ZERO,
2875
- witness: Witness::new(),
2876
- },
2877
- TransactionU16LenLimited::new(pre_funding_transaction.clone()).unwrap(), // TODO err?
2878
- ))
2879
- } else {
2880
- Err(ChannelError::Warn("Internal error: Missing previous funding transaction outpoint".to_string()))
2881
- }
2882
- } else {
2883
- Err(ChannelError::Warn("Internal error: Missing previous funding transaction".to_string()))
2884
- }
2885
- }
2886
- }
2887
-
2888
2863
impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
2889
2864
fn new_for_inbound_channel<'a, ES: Deref, F: Deref, L: Deref>(
2890
2865
fee_estimator: &'a LowerBoundedFeeEstimator<F>,
@@ -9266,7 +9241,7 @@ impl<SP: Deref> FundedChannel<SP> where
9266
9241
let pre_funding_transaction = &self.funding.funding_transaction;
9267
9242
let pre_funding_txo = &self.funding.get_funding_txo();
9268
9243
// We need the current funding tx as an extra input
9269
- let prev_funding_input = RefundingScope ::get_input_of_previous_funding(pre_funding_transaction, pre_funding_txo)?;
9244
+ let prev_funding_input = Self ::get_input_of_previous_funding(pre_funding_transaction, pre_funding_txo)?;
9270
9245
if let Some(ref mut pending_splice) = &mut self.pending_splice {
9271
9246
pending_splice.refunding_scope = Some(refunding_scope);
9272
9247
debug_assert!(pending_splice.awaiting_splice_ack);
@@ -9294,6 +9269,29 @@ impl<SP: Deref> FundedChannel<SP> where
9294
9269
Ok(tx_msg_opt)
9295
9270
}
9296
9271
9272
+ /// Get a transaction input that is the previous funding transaction
9273
+ #[cfg(splicing)]
9274
+ fn get_input_of_previous_funding(pre_funding_transaction: &Option<Transaction>, pre_funding_txo: &Option<OutPoint>)
9275
+ -> Result<(TxIn, TransactionU16LenLimited), ChannelError> {
9276
+ if let Some(pre_funding_transaction) = pre_funding_transaction {
9277
+ if let Some(pre_funding_txo) = pre_funding_txo {
9278
+ Ok((
9279
+ TxIn {
9280
+ previous_output: pre_funding_txo.into_bitcoin_outpoint(),
9281
+ script_sig: ScriptBuf::new(),
9282
+ sequence: Sequence::ZERO,
9283
+ witness: Witness::new(),
9284
+ },
9285
+ TransactionU16LenLimited::new(pre_funding_transaction.clone()).unwrap(), // TODO err?
9286
+ ))
9287
+ } else {
9288
+ Err(ChannelError::Warn("Internal error: Missing previous funding transaction outpoint".to_string()))
9289
+ }
9290
+ } else {
9291
+ Err(ChannelError::Warn("Internal error: Missing previous funding transaction".to_string()))
9292
+ }
9293
+ }
9294
+
9297
9295
/// Splice process starting; update state, log, etc.
9298
9296
#[cfg(splicing)]
9299
9297
pub(crate) fn splice_start<L: Deref>(&mut self, is_outgoing: bool, logger: &L) where L::Target: Logger {
0 commit comments