Skip to content

Commit 33071a5

Browse files
committed
Rename TransactionData to TransactionDataRef
1 parent 8a91bd9 commit 33071a5

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use chain::Filter;
3636
use chain::chaininterface::{BroadcasterInterface, FeeEstimator};
3737
use chain::channelmonitor;
3838
use chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateErr, MonitorEvent, Persist};
39-
use chain::transaction::{OutPoint, TransactionData};
39+
use chain::transaction::{OutPoint, TransactionDataRef};
4040
use chain::keysinterface::Sign;
4141
use util::logger::Logger;
4242
use util::events;
@@ -92,7 +92,7 @@ where C::Target: chain::Filter,
9292
/// [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
9393
/// [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
9494
/// [`chain::Filter`]: ../trait.Filter.html
95-
pub fn block_connected(&self, header: &BlockHeader, txdata: &TransactionData, height: u32) {
95+
pub fn block_connected(&self, header: &BlockHeader, txdata: &TransactionDataRef, height: u32) {
9696
let monitors = self.monitors.read().unwrap();
9797
for monitor in monitors.values() {
9898
let mut txn_outputs = monitor.block_connected(header, txdata, height, &*self.broadcaster, &*self.fee_estimator, &*self.logger);

lightning/src/chain/channelmonitor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use ln::channelmanager::{HTLCSource, PaymentPreimage, PaymentHash};
4343
use ln::onchaintx::{OnchainTxHandler, InputDescriptors};
4444
use chain;
4545
use chain::chaininterface::{BroadcasterInterface, FeeEstimator};
46-
use chain::transaction::{OutPoint, TransactionData};
46+
use chain::transaction::{OutPoint, TransactionDataRef};
4747
use chain::keysinterface::{SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, Sign, KeysInterface};
4848
use chain::Filter;
4949
use util::logger::Logger;
@@ -1252,7 +1252,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
12521252
pub fn block_connected<B: Deref, F: Deref, L: Deref>(
12531253
&self,
12541254
header: &BlockHeader,
1255-
txdata: &TransactionData,
1255+
txdata: &TransactionDataRef,
12561256
height: u32,
12571257
broadcaster: B,
12581258
fee_estimator: F,
@@ -1978,7 +1978,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
19781978
return res
19791979
}
19801980

1981-
pub fn block_connected<B: Deref, F: Deref, L: Deref>(&mut self, header: &BlockHeader, txdata: &TransactionData, height: u32, broadcaster: B, fee_estimator: F, logger: L)-> Vec<(Txid, Vec<(u32, TxOut)>)>
1981+
pub fn block_connected<B: Deref, F: Deref, L: Deref>(&mut self, header: &BlockHeader, txdata: &TransactionDataRef, height: u32, broadcaster: B, fee_estimator: F, logger: L)-> Vec<(Txid, Vec<(u32, TxOut)>)>
19821982
where B::Target: BroadcasterInterface,
19831983
F::Target: FeeEstimator,
19841984
L::Target: Logger,
@@ -2119,7 +2119,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
21192119

21202120
/// Filters a block's `txdata` for transactions spending watched outputs or for any child
21212121
/// transactions thereof.
2122-
fn filter_block<'a>(&self, txdata: &TransactionData<'a>) -> Vec<&'a Transaction> {
2122+
fn filter_block<'a>(&self, txdata: &TransactionDataRef<'a>) -> Vec<&'a Transaction> {
21232123
let mut matched_txn = HashSet::new();
21242124
txdata.iter().filter(|&&(_, tx)| {
21252125
let mut matches = self.spends_watched_output(tx);

lightning/src/chain/transaction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ use bitcoin::blockdata::transaction::Transaction;
2626
/// use bitcoin::blockdata::block::Block;
2727
/// use bitcoin::blockdata::constants::genesis_block;
2828
/// use bitcoin::network::constants::Network;
29-
/// use lightning::chain::transaction::TransactionData;
29+
/// use lightning::chain::transaction::TransactionDataRef;
3030
///
3131
/// let block = genesis_block(Network::Bitcoin);
3232
/// let txdata: Vec<_> = block.txdata.iter().enumerate().collect();
3333
/// check_block(&block, &txdata);
3434
///
35-
/// fn check_block(block: &Block, txdata: &TransactionData) {
35+
/// fn check_block(block: &Block, txdata: &TransactionDataRef) {
3636
/// assert_eq!(block.txdata.len(), 1);
3737
/// assert_eq!(txdata.len(), 1);
3838
///
@@ -41,7 +41,7 @@ use bitcoin::blockdata::transaction::Transaction;
4141
/// assert_eq!(tx, &block.txdata[0]);
4242
/// }
4343
/// ```
44-
pub type TransactionData<'a> = [(usize, &'a Transaction)];
44+
pub type TransactionDataRef<'a> = [(usize, &'a Transaction)];
4545

4646
/// A reference to a transaction output.
4747
///

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use ln::chan_utils::{CounterpartyCommitmentSecrets, TxCreationKeys, HTLCOutputIn
3030
use ln::chan_utils;
3131
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
3232
use chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, HTLC_FAIL_BACK_BUFFER};
33-
use chain::transaction::{OutPoint, TransactionData};
33+
use chain::transaction::{OutPoint, TransactionDataRef};
3434
use chain::keysinterface::{Sign, KeysInterface};
3535
use util::transaction_utils;
3636
use util::ser::{Readable, ReadableArgs, Writeable, Writer, VecWriter};
@@ -3498,7 +3498,7 @@ impl<Signer: Sign> Channel<Signer> {
34983498
///
34993499
/// May return some HTLCs (and their payment_hash) which have timed out and should be failed
35003500
/// back.
3501-
pub fn block_connected(&mut self, header: &BlockHeader, txdata: &TransactionData, height: u32) -> Result<(Option<msgs::FundingLocked>, Vec<(HTLCSource, PaymentHash)>), msgs::ErrorMessage> {
3501+
pub fn block_connected(&mut self, header: &BlockHeader, txdata: &TransactionDataRef, height: u32) -> Result<(Option<msgs::FundingLocked>, Vec<(HTLCSource, PaymentHash)>), msgs::ErrorMessage> {
35023502
let mut timed_out_htlcs = Vec::new();
35033503
self.holding_cell_htlc_updates.retain(|htlc_update| {
35043504
match htlc_update {

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use chain;
3838
use chain::Watch;
3939
use chain::chaininterface::{BroadcasterInterface, FeeEstimator};
4040
use chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, ChannelMonitorUpdateErr, HTLC_FAIL_BACK_BUFFER, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY, MonitorEvent, CLOSED_CHANNEL_UPDATE_ID};
41-
use chain::transaction::{OutPoint, TransactionData};
41+
use chain::transaction::{OutPoint, TransactionDataRef};
4242
use ln::channel::{Channel, ChannelError};
4343
use ln::features::{InitFeatures, NodeFeatures};
4444
use routing::router::{Route, RouteHop};
@@ -3253,7 +3253,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
32533253
L::Target: Logger,
32543254
{
32553255
/// Updates channel state based on transactions seen in a connected block.
3256-
pub fn block_connected(&self, header: &BlockHeader, txdata: &TransactionData, height: u32) {
3256+
pub fn block_connected(&self, header: &BlockHeader, txdata: &TransactionDataRef, height: u32) {
32573257
// Note that we MUST NOT end up calling methods on self.chain_monitor here - we're called
32583258
// during initialization prior to the chain_monitor being fully configured in some cases.
32593259
// See the docs for `ChannelManagerReadArgs` for more.

0 commit comments

Comments
 (0)