Skip to content

Commit 6c43f5d

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 47730e5 commit 6c43f5d

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
@@ -1152,7 +1152,7 @@ pub(crate) struct ChannelMonitorImpl<Signer: EcdsaChannelSigner> {
11521152
channel_keys_id: [u8; 32],
11531153
holder_revocation_basepoint: RevocationBasepoint,
11541154
channel_id: ChannelId,
1155-
first_confirmed_funding_txo: OutPoint,
1155+
first_negotiated_funding_txo: OutPoint,
11561156

11571157
counterparty_commitment_params: CounterpartyCommitmentParameters,
11581158

@@ -1575,7 +1575,7 @@ impl<Signer: EcdsaChannelSigner> Writeable for ChannelMonitorImpl<Signer> {
15751575
(21, self.balances_empty_height, option),
15761576
(23, self.holder_pays_commitment_tx_fee, option),
15771577
(25, self.payment_preimages, required),
1578-
(27, self.first_confirmed_funding_txo, required),
1578+
(27, self.first_negotiated_funding_txo, required),
15791579
(29, self.initial_counterparty_commitment_tx, option),
15801580
(31, self.funding.channel_parameters, required),
15811581
(32, self.pending_funding, optional_vec),
@@ -1761,7 +1761,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
17611761
channel_keys_id,
17621762
holder_revocation_basepoint,
17631763
channel_id,
1764-
first_confirmed_funding_txo: funding_outpoint,
1764+
first_negotiated_funding_txo: funding_outpoint,
17651765

17661766
counterparty_commitment_params,
17671767
their_cur_per_commitment_points: None,
@@ -1820,7 +1820,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
18201820
/// [`Persist`]: crate::chain::chainmonitor::Persist
18211821
pub fn persistence_key(&self) -> MonitorName {
18221822
let inner = self.inner.lock().unwrap();
1823-
let funding_outpoint = inner.first_confirmed_funding_txo;
1823+
let funding_outpoint = inner.first_negotiated_funding_txo;
18241824
let channel_id = inner.channel_id;
18251825
if ChannelId::v1_from_funding_outpoint(funding_outpoint) == channel_id {
18261826
MonitorName::V1Channel(funding_outpoint)
@@ -5724,7 +5724,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
57245724
let mut channel_id = None;
57255725
let mut holder_pays_commitment_tx_fee = None;
57265726
let mut payment_preimages_with_info: Option<HashMap<_, _>> = None;
5727-
let mut first_confirmed_funding_txo = RequiredWrapper(None);
5727+
let mut first_negotiated_funding_txo = RequiredWrapper(None);
57285728
let mut channel_parameters = None;
57295729
let mut pending_funding = None;
57305730
read_tlv_fields!(reader, {
@@ -5741,7 +5741,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
57415741
(21, balances_empty_height, option),
57425742
(23, holder_pays_commitment_tx_fee, option),
57435743
(25, payment_preimages_with_info, option),
5744-
(27, first_confirmed_funding_txo, (default_value, outpoint)),
5744+
(27, first_negotiated_funding_txo, (default_value, outpoint)),
57455745
(29, initial_counterparty_commitment_tx, option),
57465746
(31, channel_parameters, (option: ReadableArgs, None)),
57475747
(32, pending_funding, optional_vec),
@@ -5873,7 +5873,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
58735873
channel_keys_id,
58745874
holder_revocation_basepoint,
58755875
channel_id,
5876-
first_confirmed_funding_txo: first_confirmed_funding_txo.0.unwrap(),
5876+
first_negotiated_funding_txo: first_negotiated_funding_txo.0.unwrap(),
58775877

58785878
counterparty_commitment_params,
58795879
their_cur_per_commitment_points,

0 commit comments

Comments
 (0)