@@ -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),
@@ -4446,17 +4446,17 @@ where
4446
4446
/// Handles the generation of a funding transaction, optionally (for tests) with a function
4447
4447
/// which checks the correctness of the funding transaction given the associated channel.
4448
4448
fn funding_transaction_generated_intern<FundingOutput: FnMut(&OutboundV1Channel<SP>) -> Result<OutPoint, &'static str>>(
4449
- &self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding_transaction: Transaction, is_batch_funding: bool,
4449
+ &self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding_transaction: Transaction, is_batch_funding: bool,
4450
4450
mut find_funding_output: FundingOutput, is_manual_broadcast: bool,
4451
4451
) -> Result<(), APIError> {
4452
4452
let per_peer_state = self.per_peer_state.read().unwrap();
4453
- let peer_state_mutex = per_peer_state.get(counterparty_node_id)
4453
+ let peer_state_mutex = per_peer_state.get(& counterparty_node_id)
4454
4454
.ok_or_else(|| APIError::ChannelUnavailable { err: format!("Can't find a peer matching the passed counterparty node_id {}", counterparty_node_id) })?;
4455
4455
4456
4456
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
4457
4457
let peer_state = &mut *peer_state_lock;
4458
4458
let funding_txo;
4459
- let (mut chan, msg_opt) = match peer_state.channel_by_id.remove(temporary_channel_id) {
4459
+ let (mut chan, msg_opt) = match peer_state.channel_by_id.remove(& temporary_channel_id) {
4460
4460
Some(ChannelPhase::UnfundedOutboundV1(mut chan)) => {
4461
4461
macro_rules! close_chan { ($err: expr, $api_err: expr, $chan: expr) => { {
4462
4462
let counterparty;
@@ -4492,7 +4492,7 @@ where
4492
4492
}
4493
4493
},
4494
4494
Some(phase) => {
4495
- peer_state.channel_by_id.insert(* temporary_channel_id, phase);
4495
+ peer_state.channel_by_id.insert(temporary_channel_id, phase);
4496
4496
return Err(APIError::APIMisuseError {
4497
4497
err: format!(
4498
4498
"Channel with id {} for the passed counterparty node_id {} is not an unfunded, outbound V1 channel",
@@ -4542,7 +4542,7 @@ where
4542
4542
}
4543
4543
4544
4544
#[cfg(test)]
4545
- pub(crate) fn funding_transaction_generated_unchecked(&self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding_transaction: Transaction, output_index: u16) -> Result<(), APIError> {
4545
+ pub(crate) fn funding_transaction_generated_unchecked(&self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding_transaction: Transaction, output_index: u16) -> Result<(), APIError> {
4546
4546
let txid = funding_transaction.txid();
4547
4547
self.funding_transaction_generated_intern(temporary_channel_id, counterparty_node_id, funding_transaction, false, |_| {
4548
4548
Ok(OutPoint { txid, index: output_index })
@@ -4579,8 +4579,8 @@ where
4579
4579
///
4580
4580
/// [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
4581
4581
/// [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
4582
- pub fn funding_transaction_generated(&self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding_transaction: Transaction) -> Result<(), APIError> {
4583
- self.batch_funding_transaction_generated(&[(temporary_channel_id, counterparty_node_id)], funding_transaction)
4582
+ pub fn funding_transaction_generated(&self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding_transaction: Transaction) -> Result<(), APIError> {
4583
+ self.batch_funding_transaction_generated(&[(& temporary_channel_id, & counterparty_node_id)], funding_transaction)
4584
4584
}
4585
4585
4586
4586
@@ -4611,10 +4611,10 @@ where
4611
4611
/// [`Event::FundingTxBroadcastSafe`]: crate::events::Event::FundingTxBroadcastSafe
4612
4612
/// [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
4613
4613
/// [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
4614
- pub fn unsafe_manual_funding_transaction_generated(&self, temporary_channel_id: & ChannelId, counterparty_node_id: & PublicKey, funding: OutPoint) -> Result<(), APIError> {
4614
+ pub fn unsafe_manual_funding_transaction_generated(&self, temporary_channel_id: ChannelId, counterparty_node_id: PublicKey, funding: OutPoint) -> Result<(), APIError> {
4615
4615
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
4616
4616
4617
- let temporary_channels = &[(temporary_channel_id, counterparty_node_id)];
4617
+ let temporary_channels = &[(& temporary_channel_id, & counterparty_node_id)];
4618
4618
return self.batch_funding_transaction_generated_intern(temporary_channels, FundingType::Unchecked(funding));
4619
4619
4620
4620
}
@@ -4688,8 +4688,8 @@ where
4688
4688
let is_manual_broadcast = funding.is_manual_broadcast();
4689
4689
for &(temporary_channel_id, counterparty_node_id) in temporary_channels {
4690
4690
result = result.and_then(|_| self.funding_transaction_generated_intern(
4691
- temporary_channel_id,
4692
- counterparty_node_id,
4691
+ * temporary_channel_id,
4692
+ * counterparty_node_id,
4693
4693
funding.transaction_or_dummy(),
4694
4694
is_batch_funding,
4695
4695
|chan| {
@@ -13348,7 +13348,7 @@ mod tests {
13348
13348
assert_eq!(nodes[1].node.outpoint_to_peer.lock().unwrap().len(), 0);
13349
13349
}
13350
13350
13351
- nodes[0].node.funding_transaction_generated(& temporary_channel_id, & nodes[1].node.get_our_node_id(), tx.clone()).unwrap();
13351
+ nodes[0].node.funding_transaction_generated(temporary_channel_id, nodes[1].node.get_our_node_id(), tx.clone()).unwrap();
13352
13352
{
13353
13353
// Assert that `nodes[0]`'s `outpoint_to_peer` map is populated with the channel as soon as
13354
13354
// as it has the funding transaction.
@@ -13560,7 +13560,7 @@ mod tests {
13560
13560
nodes[0].node.handle_accept_channel(&nodes[1].node.get_our_node_id(), &accept_channel);
13561
13561
let (temporary_channel_id, tx, _) = create_funding_transaction(&nodes[0], &nodes[1].node.get_our_node_id(), 100_000, 42);
13562
13562
funding_tx = Some(tx.clone());
13563
- nodes[0].node.funding_transaction_generated(& temporary_channel_id, & nodes[1].node.get_our_node_id(), tx).unwrap();
13563
+ nodes[0].node.funding_transaction_generated(temporary_channel_id, nodes[1].node.get_our_node_id(), tx).unwrap();
13564
13564
let funding_created_msg = get_event_msg!(nodes[0], MessageSendEvent::SendFundingCreated, nodes[1].node.get_our_node_id());
13565
13565
13566
13566
nodes[1].node.handle_funding_created(&nodes[0].node.get_our_node_id(), &funding_created_msg);
@@ -14215,7 +14215,7 @@ pub mod bench {
14215
14215
tx = Transaction { version: Version::TWO, lock_time: LockTime::ZERO, input: Vec::new(), output: vec![TxOut {
14216
14216
value: Amount::from_sat(8_000_000), script_pubkey: output_script,
14217
14217
}]};
14218
- node_a.funding_transaction_generated(& temporary_channel_id, & node_b.get_our_node_id(), tx.clone()).unwrap();
14218
+ node_a.funding_transaction_generated(temporary_channel_id, node_b.get_our_node_id(), tx.clone()).unwrap();
14219
14219
} else { panic!(); }
14220
14220
14221
14221
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