@@ -1452,7 +1452,7 @@ where
1452
1452
/// channel_value_satoshis, output_script
1453
1453
/// );
1454
1454
/// match channel_manager.funding_transaction_generated(
1455
- /// & temporary_channel_id, & counterparty_node_id, funding_transaction
1455
+ /// temporary_channel_id, counterparty_node_id, funding_transaction
1456
1456
/// ) {
1457
1457
/// Ok(()) => println!("Funding channel {}", temporary_channel_id),
1458
1458
/// Err(e) => println!("Error funding channel {}: {:?}", temporary_channel_id, e),
@@ -4444,17 +4444,17 @@ where
4444
4444
/// Handles the generation of a funding transaction, optionally (for tests) with a function
4445
4445
/// which checks the correctness of the funding transaction given the associated channel.
4446
4446
fn funding_transaction_generated_intern<FundingOutput: FnMut(&OutboundV1Channel<SP>) -> Result<OutPoint, &'static str>>(
4447
- &self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding_transaction: Transaction, is_batch_funding: bool,
4447
+ &self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding_transaction: Transaction, is_batch_funding: bool,
4448
4448
mut find_funding_output: FundingOutput, is_manual_broadcast: bool,
4449
4449
) -> Result<(), APIError> {
4450
4450
let per_peer_state = self.per_peer_state.read().unwrap();
4451
- let peer_state_mutex = per_peer_state.get(counterparty_node_id)
4451
+ let peer_state_mutex = per_peer_state.get(& counterparty_node_id)
4452
4452
.ok_or_else(|| APIError::ChannelUnavailable { err: format!("Can't find a peer matching the passed counterparty node_id {}", counterparty_node_id) })?;
4453
4453
4454
4454
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
4455
4455
let peer_state = &mut *peer_state_lock;
4456
4456
let funding_txo;
4457
- let (mut chan, msg_opt) = match peer_state.channel_by_id.remove(temporary_channel_id) {
4457
+ let (mut chan, msg_opt) = match peer_state.channel_by_id.remove(& temporary_channel_id) {
4458
4458
Some(ChannelPhase::UnfundedOutboundV1(mut chan)) => {
4459
4459
macro_rules! close_chan { ($err: expr, $api_err: expr, $chan: expr) => { {
4460
4460
let counterparty;
@@ -4490,7 +4490,7 @@ where
4490
4490
}
4491
4491
},
4492
4492
Some(phase) => {
4493
- peer_state.channel_by_id.insert(* temporary_channel_id, phase);
4493
+ peer_state.channel_by_id.insert(temporary_channel_id, phase);
4494
4494
return Err(APIError::APIMisuseError {
4495
4495
err: format!(
4496
4496
"Channel with id {} for the passed counterparty node_id {} is not an unfunded, outbound V1 channel",
@@ -4540,7 +4540,7 @@ where
4540
4540
}
4541
4541
4542
4542
#[cfg(test)]
4543
- pub(crate) fn funding_transaction_generated_unchecked(&self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding_transaction: Transaction, output_index: u16) -> Result<(), APIError> {
4543
+ pub(crate) fn funding_transaction_generated_unchecked(&self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding_transaction: Transaction, output_index: u16) -> Result<(), APIError> {
4544
4544
let txid = funding_transaction.txid();
4545
4545
self.funding_transaction_generated_intern(temporary_channel_id, counterparty_node_id, funding_transaction, false, |_| {
4546
4546
Ok(OutPoint { txid, index: output_index })
@@ -4577,8 +4577,8 @@ where
4577
4577
///
4578
4578
/// [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
4579
4579
/// [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
4580
- pub fn funding_transaction_generated(&self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding_transaction: Transaction) -> Result<(), APIError> {
4581
- self.batch_funding_transaction_generated(&[(temporary_channel_id, counterparty_node_id)], funding_transaction)
4580
+ pub fn funding_transaction_generated(&self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding_transaction: Transaction) -> Result<(), APIError> {
4581
+ self.batch_funding_transaction_generated(&[(& temporary_channel_id, & counterparty_node_id)], funding_transaction)
4582
4582
}
4583
4583
4584
4584
@@ -4609,10 +4609,10 @@ where
4609
4609
/// [`Event::FundingTxBroadcastSafe`]: crate::events::Event::FundingTxBroadcastSafe
4610
4610
/// [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
4611
4611
/// [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
4612
- pub fn unsafe_manual_funding_transaction_generated(&self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding: OutPoint) -> Result<(), APIError> {
4612
+ pub fn unsafe_manual_funding_transaction_generated(&self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding: OutPoint) -> Result<(), APIError> {
4613
4613
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
4614
4614
4615
- let temporary_channels = &[(temporary_channel_id, counterparty_node_id)];
4615
+ let temporary_channels = &[(& temporary_channel_id, & counterparty_node_id)];
4616
4616
return self.batch_funding_transaction_generated_intern(temporary_channels, FundingType::Unchecked(funding));
4617
4617
4618
4618
}
@@ -4686,8 +4686,8 @@ where
4686
4686
let is_manual_broadcast = funding.is_manual_broadcast();
4687
4687
for &(temporary_channel_id, counterparty_node_id) in temporary_channels {
4688
4688
result = result.and_then(|_| self.funding_transaction_generated_intern(
4689
- temporary_channel_id,
4690
- counterparty_node_id,
4689
+ * temporary_channel_id,
4690
+ * counterparty_node_id,
4691
4691
funding.transaction_or_dummy(),
4692
4692
is_batch_funding,
4693
4693
|chan| {
@@ -13325,7 +13325,7 @@ mod tests {
13325
13325
assert_eq!(nodes[1].node.outpoint_to_peer.lock().unwrap().len(), 0);
13326
13326
}
13327
13327
13328
- nodes[0].node.funding_transaction_generated(& temporary_channel_id, & nodes[1].node.get_our_node_id(), tx.clone()).unwrap();
13328
+ nodes[0].node.funding_transaction_generated(temporary_channel_id, nodes[1].node.get_our_node_id(), tx.clone()).unwrap();
13329
13329
{
13330
13330
// Assert that `nodes[0]`'s `outpoint_to_peer` map is populated with the channel as soon as
13331
13331
// as it has the funding transaction.
@@ -13537,7 +13537,7 @@ mod tests {
13537
13537
nodes[0].node.handle_accept_channel(&nodes[1].node.get_our_node_id(), &accept_channel);
13538
13538
let (temporary_channel_id, tx, _) = create_funding_transaction(&nodes[0], &nodes[1].node.get_our_node_id(), 100_000, 42);
13539
13539
funding_tx = Some(tx.clone());
13540
- nodes[0].node.funding_transaction_generated(& temporary_channel_id, & nodes[1].node.get_our_node_id(), tx).unwrap();
13540
+ nodes[0].node.funding_transaction_generated(temporary_channel_id, nodes[1].node.get_our_node_id(), tx).unwrap();
13541
13541
let funding_created_msg = get_event_msg!(nodes[0], MessageSendEvent::SendFundingCreated, nodes[1].node.get_our_node_id());
13542
13542
13543
13543
nodes[1].node.handle_funding_created(&nodes[0].node.get_our_node_id(), &funding_created_msg);
@@ -14192,7 +14192,7 @@ pub mod bench {
14192
14192
tx = Transaction { version: Version::TWO, lock_time: LockTime::ZERO, input: Vec::new(), output: vec![TxOut {
14193
14193
value: Amount::from_sat(8_000_000), script_pubkey: output_script,
14194
14194
}]};
14195
- node_a.funding_transaction_generated(& temporary_channel_id, & node_b.get_our_node_id(), tx.clone()).unwrap();
14195
+ node_a.funding_transaction_generated(temporary_channel_id, node_b.get_our_node_id(), tx.clone()).unwrap();
14196
14196
} else { panic!(); }
14197
14197
14198
14198
node_b.handle_funding_created(&node_a.get_our_node_id(), &get_event_msg!(node_a_holder, MessageSendEvent::SendFundingCreated, node_b.get_our_node_id()));
0 commit comments