Skip to content

Commit 1d57e01

Browse files
committed
Remove redundant 'outbound' wording from methods
1 parent 3c84db4 commit 1d57e01

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

lightning/src/chain/onchaintx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ impl<ChannelSigner: WriteableEcdsaChannelSigner> OnchainTxHandler<ChannelSigner>
11041104
}
11051105

11061106
//TODO: getting lastest holder transactions should be infallible and result in us "force-closing the channel", but we may
1107-
// have empty holder commitment transaction if a ChannelMonitor is asked to force-close just after Channel::get_outbound_funding_created,
1107+
// have empty holder commitment transaction if a ChannelMonitor is asked to force-close just after OutboundV1Channel::get_funding_created,
11081108
// before providing a initial commitment transaction. For outbound channel, init ChannelMonitor at Channel::funding_signed, there is nothing
11091109
// to monitor before.
11101110
pub(crate) fn get_fully_signed_holder_tx(&mut self, funding_redeemscript: &Script) -> Transaction {

lightning/src/ln/channel.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
991991
}
992992

993993
/// Returns the funding_txo we either got from our peer, or were given by
994-
/// get_outbound_funding_created.
994+
/// get_funding_created.
995995
pub fn get_funding_txo(&self) -> Option<OutPoint> {
996996
self.channel_transaction_parameters.funding_outpoint
997997
}
@@ -1436,7 +1436,7 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
14361436
#[inline]
14371437
/// Creates a set of keys for build_commitment_transaction to generate a transaction which we
14381438
/// will sign and send to our counterparty.
1439-
/// If an Err is returned, it is a ChannelError::Close (for get_outbound_funding_created)
1439+
/// If an Err is returned, it is a ChannelError::Close (for get_funding_created)
14401440
fn build_remote_transaction_keys(&self) -> TxCreationKeys {
14411441
//TODO: Ensure that the payment_key derived here ends up in the library users' wallet as we
14421442
//may see payments to it!
@@ -2022,7 +2022,7 @@ fn commit_tx_fee_msat(feerate_per_kw: u32, num_htlcs: usize, channel_type_featur
20222022

20232023
// TODO: We should refactor this to be an Inbound/OutboundChannel until initial setup handshaking
20242024
// has been completed, and then turn into a Channel to get compiler-time enforcement of things like
2025-
// calling channel_id() before we're set up or things like get_outbound_funding_signed on an
2025+
// calling channel_id() before we're set up or things like get_funding_signed on an
20262026
// inbound channel.
20272027
//
20282028
// Holder designates channel data owned for the benefit of the user client.
@@ -5658,8 +5658,8 @@ impl<Signer: WriteableEcdsaChannelSigner> OutboundV1Channel<Signer> {
56585658
})
56595659
}
56605660

5661-
/// If an Err is returned, it is a ChannelError::Close (for get_outbound_funding_created)
5662-
fn get_outbound_funding_created_signature<L: Deref>(&mut self, logger: &L) -> Result<Signature, ChannelError> where L::Target: Logger {
5661+
/// If an Err is returned, it is a ChannelError::Close (for get_funding_created)
5662+
fn get_funding_created_signature<L: Deref>(&mut self, logger: &L) -> Result<Signature, ChannelError> where L::Target: Logger {
56635663
let counterparty_keys = self.context.build_remote_transaction_keys();
56645664
let counterparty_initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, false, logger).tx;
56655665
Ok(self.context.holder_signer.sign_counterparty_commitment(&counterparty_initial_commitment_tx, Vec::new(), &self.context.secp_ctx)
@@ -5673,7 +5673,7 @@ impl<Signer: WriteableEcdsaChannelSigner> OutboundV1Channel<Signer> {
56735673
/// Note that channel_id changes during this call!
56745674
/// Do NOT broadcast the funding transaction until after a successful funding_signed call!
56755675
/// If an Err is returned, it is a ChannelError::Close.
5676-
pub fn get_outbound_funding_created<L: Deref>(mut self, funding_transaction: Transaction, funding_txo: OutPoint, logger: &L)
5676+
pub fn get_funding_created<L: Deref>(mut self, funding_transaction: Transaction, funding_txo: OutPoint, logger: &L)
56775677
-> Result<(Channel<Signer>, msgs::FundingCreated), (Self, ChannelError)> where L::Target: Logger {
56785678
if !self.context.is_outbound() {
56795679
panic!("Tried to create outbound funding_created message on an inbound channel!");
@@ -5690,7 +5690,7 @@ impl<Signer: WriteableEcdsaChannelSigner> OutboundV1Channel<Signer> {
56905690
self.context.channel_transaction_parameters.funding_outpoint = Some(funding_txo);
56915691
self.context.holder_signer.provide_channel_parameters(&self.context.channel_transaction_parameters);
56925692

5693-
let signature = match self.get_outbound_funding_created_signature(logger) {
5693+
let signature = match self.get_funding_created_signature(logger) {
56945694
Ok(res) => res,
56955695
Err(e) => {
56965696
log_error!(logger, "Got bad signatures: {:?}!", e);
@@ -7567,7 +7567,7 @@ mod tests {
75677567
value: 10000000, script_pubkey: output_script.clone(),
75687568
}]};
75697569
let funding_outpoint = OutPoint{ txid: tx.txid(), index: 0 };
7570-
let (mut node_a_chan, funding_created_msg) = node_a_chan.get_outbound_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap();
7570+
let (mut node_a_chan, funding_created_msg) = node_a_chan.get_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap();
75717571
let (_, funding_signed_msg, _) = node_b_chan.funding_created(&funding_created_msg, best_block, &&keys_provider, &&logger).map_err(|_| ()).unwrap();
75727572

75737573
// Node B --> Node A: funding signed
@@ -7694,7 +7694,7 @@ mod tests {
76947694
value: 10000000, script_pubkey: output_script.clone(),
76957695
}]};
76967696
let funding_outpoint = OutPoint{ txid: tx.txid(), index: 0 };
7697-
let (mut node_a_chan, funding_created_msg) = node_a_chan.get_outbound_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap();
7697+
let (mut node_a_chan, funding_created_msg) = node_a_chan.get_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap();
76987698
let (mut node_b_chan, funding_signed_msg, _) = node_b_chan.funding_created(&funding_created_msg, best_block, &&keys_provider, &&logger).map_err(|_| ()).unwrap();
76997699

77007700
// Node B --> Node A: funding signed
@@ -7882,7 +7882,7 @@ mod tests {
78827882
value: 10000000, script_pubkey: output_script.clone(),
78837883
}]};
78847884
let funding_outpoint = OutPoint{ txid: tx.txid(), index: 0 };
7885-
let (mut node_a_chan, funding_created_msg) = node_a_chan.get_outbound_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap();
7885+
let (mut node_a_chan, funding_created_msg) = node_a_chan.get_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap();
78867886
let (_, funding_signed_msg, _) = node_b_chan.funding_created(&funding_created_msg, best_block, &&keys_provider, &&logger).map_err(|_| ()).unwrap();
78877887

78887888
// Node B --> Node A: funding signed

lightning/src/ln/channelmanager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,7 @@ where
33693369
Some(chan) => {
33703370
let funding_txo = find_funding_output(&chan, &funding_transaction)?;
33713371

3372-
let funding_res = chan.get_outbound_funding_created(funding_transaction, funding_txo, &self.logger)
3372+
let funding_res = chan.get_funding_created(funding_transaction, funding_txo, &self.logger)
33733373
.map_err(|(mut chan, e)| if let ChannelError::Close(msg) = e {
33743374
let channel_id = chan.context.channel_id();
33753375
let user_id = chan.context.get_user_id();

lightning/src/ln/functional_tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8881,13 +8881,13 @@ fn test_duplicate_chan_id() {
88818881
let (_, funding_created) = {
88828882
let per_peer_state = nodes[0].node.per_peer_state.read().unwrap();
88838883
let mut a_peer_state = per_peer_state.get(&nodes[1].node.get_our_node_id()).unwrap().lock().unwrap();
8884-
// Once we call `get_outbound_funding_created` the channel has a duplicate channel_id as
8884+
// Once we call `get_funding_created` the channel has a duplicate channel_id as
88858885
// another channel in the ChannelManager - an invalid state. Thus, we'd panic later when we
88868886
// try to create another channel. Instead, we drop the channel entirely here (leaving the
88878887
// channelmanager in a possibly nonsense state instead).
88888888
let mut as_chan = a_peer_state.outbound_v1_channel_by_id.remove(&open_chan_2_msg.temporary_channel_id).unwrap();
88898889
let logger = test_utils::TestLogger::new();
8890-
as_chan.get_outbound_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap()
8890+
as_chan.get_funding_created(tx.clone(), funding_outpoint, &&logger).map_err(|_| ()).unwrap()
88918891
};
88928892
check_added_monitors!(nodes[0], 0);
88938893
nodes[1].node.handle_funding_created(&nodes[0].node.get_our_node_id(), &funding_created);

0 commit comments

Comments
 (0)