Skip to content

Commit 54a6e0d

Browse files
committed
Rename ChannelMonitor::first_confirmed_funding_txo
It's only intended to be set during initialization and used to check if the channel is v1 or v2. We rename it to `first_negotiated_funding_txo` to better reflect its purpose.
1 parent 120a677 commit 54a6e0d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ pub(crate) struct ChannelMonitorImpl<Signer: EcdsaChannelSigner> {
11241124
channel_keys_id: [u8; 32],
11251125
holder_revocation_basepoint: RevocationBasepoint,
11261126
channel_id: ChannelId,
1127-
first_confirmed_funding_txo: OutPoint,
1127+
first_negotiated_funding_txo: OutPoint,
11281128

11291129
counterparty_commitment_params: CounterpartyCommitmentParameters,
11301130

@@ -1549,7 +1549,7 @@ impl<Signer: EcdsaChannelSigner> Writeable for ChannelMonitorImpl<Signer> {
15491549
(21, self.balances_empty_height, option),
15501550
(23, self.holder_pays_commitment_tx_fee, option),
15511551
(25, self.payment_preimages, required),
1552-
(27, self.first_confirmed_funding_txo, required),
1552+
(27, self.first_negotiated_funding_txo, required),
15531553
(29, self.initial_counterparty_commitment_tx, option),
15541554
(31, self.funding.channel_parameters, required),
15551555
(32, self.pending_funding, optional_vec),
@@ -1733,7 +1733,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
17331733
channel_keys_id,
17341734
holder_revocation_basepoint,
17351735
channel_id,
1736-
first_confirmed_funding_txo: funding_outpoint,
1736+
first_negotiated_funding_txo: funding_outpoint,
17371737

17381738
counterparty_commitment_params,
17391739
their_cur_per_commitment_points: None,
@@ -1792,7 +1792,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
17921792
/// [`Persist`]: crate::chain::chainmonitor::Persist
17931793
pub fn persistence_key(&self) -> MonitorName {
17941794
let inner = self.inner.lock().unwrap();
1795-
let funding_outpoint = inner.first_confirmed_funding_txo;
1795+
let funding_outpoint = inner.first_negotiated_funding_txo;
17961796
let channel_id = inner.channel_id;
17971797
if ChannelId::v1_from_funding_outpoint(funding_outpoint) == channel_id {
17981798
MonitorName::V1Channel(funding_outpoint)
@@ -5865,7 +5865,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
58655865
let mut channel_id = None;
58665866
let mut holder_pays_commitment_tx_fee = None;
58675867
let mut payment_preimages_with_info: Option<HashMap<_, _>> = None;
5868-
let mut first_confirmed_funding_txo = RequiredWrapper(None);
5868+
let mut first_negotiated_funding_txo = RequiredWrapper(None);
58695869
let mut channel_parameters = None;
58705870
let mut pending_funding = None;
58715871
read_tlv_fields!(reader, {
@@ -5882,7 +5882,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
58825882
(21, balances_empty_height, option),
58835883
(23, holder_pays_commitment_tx_fee, option),
58845884
(25, payment_preimages_with_info, option),
5885-
(27, first_confirmed_funding_txo, (default_value, outpoint)),
5885+
(27, first_negotiated_funding_txo, (default_value, outpoint)),
58865886
(29, initial_counterparty_commitment_tx, option),
58875887
(31, channel_parameters, (option: ReadableArgs, None)),
58885888
(32, pending_funding, optional_vec),
@@ -6012,7 +6012,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
60126012
channel_keys_id,
60136013
holder_revocation_basepoint,
60146014
channel_id,
6015-
first_confirmed_funding_txo: first_confirmed_funding_txo.0.unwrap(),
6015+
first_negotiated_funding_txo: first_negotiated_funding_txo.0.unwrap(),
60166016

60176017
counterparty_commitment_params,
60186018
their_cur_per_commitment_points,

0 commit comments

Comments
 (0)