Skip to content

Commit 40bbfd7

Browse files
committed
Refactor to collect only funding transaction in event from channel
1 parent c4a2bcb commit 40bbfd7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,10 @@ impl<Signer: Sign> Channel<Signer> {
13061306
self.channel_transaction_parameters.funding_outpoint.unwrap()
13071307
}
13081308

1309+
pub(crate) fn funding_transaction(&self) -> Option<Transaction> {
1310+
self.funding_transaction.clone()
1311+
}
1312+
13091313
#[inline]
13101314
/// Creates a set of keys for build_commitment_transaction to generate a transaction which our
13111315
/// counterparty will sign (ie DO NOT send signatures over a transaction created by this to

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
13301330
fn issue_channel_close_events(&self, channel: &Channel<Signer>, closure_reason: ClosureReason) {
13311331
let mut pending_events_lock = self.pending_events.lock().unwrap();
13321332
if channel.is_funding_pending() {
1333-
pending_events_lock.push(events::Event::DiscardFunding { channel_id: channel.channel_id(), transaction: channel.channel_transaction_parameters.funding_outpoint});
1333+
pending_events_lock.push(events::Event::DiscardFunding { channel_id: channel.channel_id(), transaction: channel.funding_transaction() });
13341334
}
13351335
pending_events_lock.push(events::Event::ChannelClosed { channel_id: channel.channel_id(), reason: closure_reason });
13361336
}

lightning/src/util/events.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//! few other things.
1616
1717
use chain::keysinterface::SpendableOutputDescriptor;
18-
use chain::transaction::OutPoint;
1918
use ln::msgs;
2019
use ln::msgs::DecodeError;
2120
use ln::{PaymentPreimage, PaymentHash, PaymentSecret};
@@ -31,6 +30,7 @@ use io;
3130
use prelude::*;
3231
use core::time::Duration;
3332
use core::ops::Deref;
33+
use bitcoin::Transaction;
3434

3535
/// Some information provided on receipt of payment depends on whether the payment received is a
3636
/// spontaneous payment or a "conventional" lightning payment that's paying an invoice.
@@ -262,7 +262,7 @@ pub enum Event {
262262
/// The channel_id of the channel which has been closed.
263263
channel_id: [u8; 32],
264264
/// The full transaction received from the user
265-
transaction: Option<OutPoint>
265+
transaction: Option<Transaction>
266266
}
267267
}
268268

0 commit comments

Comments
 (0)