Skip to content

Commit 5feff58

Browse files
committed
Minor rename (review, funding_feerate_per_kw)
1 parent ea76587 commit 5feff58

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4594,7 +4594,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
45944594
/// Get the splice message that can be sent during splice initiation.
45954595
#[cfg(splicing)]
45964596
pub fn get_splice_init(&self, our_funding_contribution_satoshis: i64,
4597-
funding_feerate_perkw: u32, locktime: u32,
4597+
funding_feerate_per_kw: u32, locktime: u32,
45984598
) -> msgs::SpliceInit {
45994599
// Reuse the existing funding pubkey, in spite of the channel value changing
46004600
// (though at this point we don't know the new value yet, due tue the optional counterparty contribution)
@@ -4603,7 +4603,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
46034603
msgs::SpliceInit {
46044604
channel_id: self.channel_id,
46054605
funding_contribution_satoshis: our_funding_contribution_satoshis,
4606-
funding_feerate_perkw,
4606+
funding_feerate_per_kw,
46074607
locktime,
46084608
funding_pubkey,
46094609
require_confirmed_inputs: None,
@@ -8367,7 +8367,7 @@ impl<SP: Deref> FundedChannel<SP> where
83678367
/// Initiate splicing
83688368
#[cfg(splicing)]
83698369
pub fn splice_channel(&mut self, our_funding_contribution_satoshis: i64,
8370-
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_perkw: u32, locktime: u32,
8370+
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_per_kw: u32, locktime: u32,
83718371
) -> Result<msgs::SpliceInit, ChannelError> {
83728372
// Check if a splice has been initiated already.
83738373
// Note: this could be handled more nicely, and support multiple outstanding splice's, the incoming splice_ack matters anyways.
@@ -8415,7 +8415,7 @@ impl<SP: Deref> FundedChannel<SP> where
84158415
our_funding_contribution: our_funding_contribution_satoshis,
84168416
});
84178417

8418-
let msg = self.context.get_splice_init(our_funding_contribution_satoshis, funding_feerate_perkw, locktime);
8418+
let msg = self.context.get_splice_init(our_funding_contribution_satoshis, funding_feerate_per_kw, locktime);
84198419
Ok(msg)
84208420
}
84218421

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4288,7 +4288,7 @@ where
42884288
#[cfg(splicing)]
42894289
pub fn splice_channel(
42904290
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
4291-
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_perkw: u32, locktime: u32,
4291+
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_per_kw: u32, locktime: u32,
42924292
) -> Result<(), APIError> {
42934293
let per_peer_state = self.per_peer_state.read().unwrap();
42944294

@@ -4302,7 +4302,7 @@ where
43024302
match peer_state.channel_by_id.entry(*channel_id) {
43034303
hash_map::Entry::Occupied(mut chan_phase_entry) => {
43044304
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4305-
let msg = chan.splice_channel(our_funding_contribution_satoshis, our_funding_inputs, funding_feerate_perkw, locktime)
4305+
let msg = chan.splice_channel(our_funding_contribution_satoshis, our_funding_inputs, funding_feerate_per_kw, locktime)
43064306
.map_err(|err| APIError::APIMisuseError {
43074307
err: format!(
43084308
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id

lightning/src/ln/functional_tests_splice.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn test_v1_splice_in() {
226226

227227
// Amount being added to the channel through the splice-in
228228
let splice_in_sats: u64 = 20000;
229-
let funding_feerate_perkw = 1024; // TODO
229+
let funding_feerate_per_kw = 1024; // TODO
230230
let locktime = 0; // TODO
231231

232232
// Create additional inputs
@@ -243,7 +243,7 @@ fn test_v1_splice_in() {
243243
&acceptor_node.node.get_our_node_id(),
244244
splice_in_sats as i64,
245245
funding_inputs,
246-
funding_feerate_perkw,
246+
funding_feerate_per_kw,
247247
locktime,
248248
)
249249
.unwrap();
@@ -254,7 +254,7 @@ fn test_v1_splice_in() {
254254
acceptor_node.node.get_our_node_id()
255255
);
256256
assert_eq!(splice_init_msg.funding_contribution_satoshis, splice_in_sats as i64);
257-
assert_eq!(splice_init_msg.funding_feerate_perkw, funding_feerate_perkw);
257+
assert_eq!(splice_init_msg.funding_feerate_per_kw, funding_feerate_per_kw);
258258
assert_eq!(splice_init_msg.funding_pubkey.to_string(), expected_initiator_funding_key);
259259
assert!(splice_init_msg.require_confirmed_inputs.is_none());
260260

lightning/src/ln/msgs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ pub struct SpliceInit {
470470
/// or remove from its channel balance (splice-out).
471471
pub funding_contribution_satoshis: i64,
472472
/// The feerate for the new funding transaction, set by the splice initiator
473-
pub funding_feerate_perkw: u32,
473+
pub funding_feerate_per_kw: u32,
474474
/// The locktime for the new funding transaction
475475
pub locktime: u32,
476476
/// The key of the sender (splice initiator) controlling the new funding transaction
@@ -2239,7 +2239,7 @@ impl_writeable_msg!(Stfu, {
22392239
impl_writeable_msg!(SpliceInit, {
22402240
channel_id,
22412241
funding_contribution_satoshis,
2242-
funding_feerate_perkw,
2242+
funding_feerate_per_kw,
22432243
locktime,
22442244
funding_pubkey,
22452245
}, {
@@ -4099,7 +4099,7 @@ mod tests {
40994099
let splice_init = msgs::SpliceInit {
41004100
channel_id: ChannelId::from_bytes([2; 32]),
41014101
funding_contribution_satoshis: -123456,
4102-
funding_feerate_perkw: 2000,
4102+
funding_feerate_per_kw: 2000,
41034103
locktime: 0,
41044104
funding_pubkey: pubkey_1,
41054105
require_confirmed_inputs: Some(()),

0 commit comments

Comments
 (0)