Skip to content

Commit c6d8076

Browse files
committed
Minor rename (review, funding_feerate_per_kw)
1 parent c967b50 commit c6d8076

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
@@ -4344,7 +4344,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
43444344
/// Get the splice message that can be sent during splice initiation.
43454345
#[cfg(splicing)]
43464346
pub fn get_splice_init(&self, our_funding_contribution_satoshis: i64,
4347-
funding_feerate_perkw: u32, locktime: u32,
4347+
funding_feerate_per_kw: u32, locktime: u32,
43484348
) -> msgs::SpliceInit {
43494349
// Reuse the existing funding pubkey, in spite of the channel value changing
43504350
// (though at this point we don't know the new value yet, due tue the optional counterparty contribution)
@@ -4353,7 +4353,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
43534353
msgs::SpliceInit {
43544354
channel_id: self.channel_id,
43554355
funding_contribution_satoshis: our_funding_contribution_satoshis,
4356-
funding_feerate_perkw,
4356+
funding_feerate_per_kw,
43574357
locktime,
43584358
funding_pubkey,
43594359
require_confirmed_inputs: None,
@@ -8116,7 +8116,7 @@ impl<SP: Deref> FundedChannel<SP> where
81168116
/// Initiate splicing
81178117
#[cfg(splicing)]
81188118
pub fn splice_channel(&mut self, our_funding_contribution_satoshis: i64,
8119-
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_perkw: u32, locktime: u32,
8119+
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_per_kw: u32, locktime: u32,
81208120
) -> Result<msgs::SpliceInit, ChannelError> {
81218121
// Check if a splice has been initiated already.
81228122
// Note: this could be handled more nicely, and support multiple outstanding splice's, the incoming splice_ack matters anyways.
@@ -8164,7 +8164,7 @@ impl<SP: Deref> FundedChannel<SP> where
81648164
our_funding_contribution: our_funding_contribution_satoshis,
81658165
});
81668166

8167-
let msg = self.context.get_splice_init(our_funding_contribution_satoshis, funding_feerate_perkw, locktime);
8167+
let msg = self.context.get_splice_init(our_funding_contribution_satoshis, funding_feerate_per_kw, locktime);
81688168
Ok(msg)
81698169
}
81708170

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4216,7 +4216,7 @@ where
42164216
#[cfg(splicing)]
42174217
pub fn splice_channel(
42184218
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
4219-
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_perkw: u32, locktime: u32,
4219+
our_funding_inputs: Vec<(TxIn, Transaction)>, funding_feerate_per_kw: u32, locktime: u32,
42204220
) -> Result<(), APIError> {
42214221
let per_peer_state = self.per_peer_state.read().unwrap();
42224222

@@ -4230,7 +4230,7 @@ where
42304230
match peer_state.channel_by_id.entry(*channel_id) {
42314231
hash_map::Entry::Occupied(mut chan_phase_entry) => {
42324232
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4233-
let msg = chan.splice_channel(our_funding_contribution_satoshis, our_funding_inputs, funding_feerate_perkw, locktime)
4233+
let msg = chan.splice_channel(our_funding_contribution_satoshis, our_funding_inputs, funding_feerate_per_kw, locktime)
42344234
.map_err(|err| APIError::APIMisuseError {
42354235
err: format!(
42364236
"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
@@ -469,7 +469,7 @@ pub struct SpliceInit {
469469
/// or remove from its channel balance (splice-out).
470470
pub funding_contribution_satoshis: i64,
471471
/// The feerate for the new funding transaction, set by the splice initiator
472-
pub funding_feerate_perkw: u32,
472+
pub funding_feerate_per_kw: u32,
473473
/// The locktime for the new funding transaction
474474
pub locktime: u32,
475475
/// The key of the sender (splice initiator) controlling the new funding transaction
@@ -2191,7 +2191,7 @@ impl_writeable_msg!(Stfu, {
21912191
impl_writeable_msg!(SpliceInit, {
21922192
channel_id,
21932193
funding_contribution_satoshis,
2194-
funding_feerate_perkw,
2194+
funding_feerate_per_kw,
21952195
locktime,
21962196
funding_pubkey,
21972197
}, {
@@ -4040,7 +4040,7 @@ mod tests {
40404040
let splice_init = msgs::SpliceInit {
40414041
channel_id: ChannelId::from_bytes([2; 32]),
40424042
funding_contribution_satoshis: -123456,
4043-
funding_feerate_perkw: 2000,
4043+
funding_feerate_per_kw: 2000,
40444044
locktime: 0,
40454045
funding_pubkey: pubkey_1,
40464046
require_confirmed_inputs: Some(()),

0 commit comments

Comments
 (0)