Skip to content

Commit a9067be

Browse files
committed
f rename possibly -> maybe
1 parent 048fd9a commit a9067be

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lightning/src/chain/channelmonitor.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ pub enum ClaimableBalance {
568568
/// HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
569569
/// fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
570570
/// likely to be claimed by our counterparty before we do.
571-
PossiblyClaimableHTLCAwaitingTimeout {
571+
MaybeClaimableHTLCAwaitingTimeout {
572572
/// The amount available to claim, in satoshis, ignoring the on-chain fees which will be
573573
/// required to do so.
574574
claimable_amount_satoshis: u64,
@@ -1381,7 +1381,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
13811381
if us.htlcs_resolved_on_chain.iter().any(|v| v.input_idx == htlc_input_idx) {
13821382
assert!(us.funding_spend_confirmed.is_some());
13831383
} else if htlc.offered == $holder_commitment {
1384-
res.push(ClaimableBalance::PossiblyClaimableHTLCAwaitingTimeout {
1384+
res.push(ClaimableBalance::MaybeClaimableHTLCAwaitingTimeout {
13851385
claimable_amount_satoshis: htlc.amount_msat / 1000,
13861386
claimable_height: htlc.cltv_expiry,
13871387
});
@@ -1428,7 +1428,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
14281428
for (htlc, _, _) in us.current_holder_commitment_tx.htlc_outputs.iter() {
14291429
if htlc.transaction_output_index.is_none() { continue; }
14301430
if htlc.offered {
1431-
res.push(ClaimableBalance::PossiblyClaimableHTLCAwaitingTimeout {
1431+
res.push(ClaimableBalance::MaybeClaimableHTLCAwaitingTimeout {
14321432
claimable_amount_satoshis: htlc.amount_msat / 1000,
14331433
claimable_height: htlc.cltv_expiry,
14341434
});

lightning/src/ln/monitor_tests.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fn test_claim_value_force_close() {
211211
assert_eq!(sorted_vec(vec![ClaimableBalance::ClaimableOnChannelClose {
212212
claimable_amount_satoshis: 1_000_000 - 3_000 - 1_000 - 3 - chan_feerate *
213213
(channel::COMMITMENT_TX_BASE_WEIGHT + channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
214-
}, ClaimableBalance::PossiblyClaimableHTLCAwaitingTimeout {
214+
}, ClaimableBalance::MaybeClaimableHTLCAwaitingTimeout {
215215
claimable_amount_satoshis: 3_000,
216216
claimable_height: htlc_cltv_timeout,
217217
}]),
@@ -238,7 +238,7 @@ fn test_claim_value_force_close() {
238238
3 - // The dust HTLC value in satoshis
239239
// The commitment transaction fee with one HTLC output:
240240
chan_feerate * (channel::COMMITMENT_TX_BASE_WEIGHT + channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
241-
}, ClaimableBalance::PossiblyClaimableHTLCAwaitingTimeout {
241+
}, ClaimableBalance::MaybeClaimableHTLCAwaitingTimeout {
242242
claimable_amount_satoshis: 3_000,
243243
claimable_height: htlc_cltv_timeout,
244244
}]),
@@ -283,7 +283,7 @@ fn test_claim_value_force_close() {
283283
claimable_amount_satoshis: 1_000_000 - 3_000 - 1_000 - 3 - chan_feerate *
284284
(channel::COMMITMENT_TX_BASE_WEIGHT + channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
285285
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 1,
286-
}, ClaimableBalance::PossiblyClaimableHTLCAwaitingTimeout {
286+
}, ClaimableBalance::MaybeClaimableHTLCAwaitingTimeout {
287287
claimable_amount_satoshis: 3_000,
288288
claimable_height: htlc_cltv_timeout,
289289
}]),
@@ -308,7 +308,7 @@ fn test_claim_value_force_close() {
308308

309309
// After ANTI_REORG_DELAY, A will consider its balance fully spendable and generate a
310310
// `SpendableOutputs` event. However, B still has to wait for the CSV delay.
311-
assert_eq!(vec![ClaimableBalance::PossiblyClaimableHTLCAwaitingTimeout {
311+
assert_eq!(vec![ClaimableBalance::MaybeClaimableHTLCAwaitingTimeout {
312312
claimable_amount_satoshis: 3_000,
313313
claimable_height: htlc_cltv_timeout,
314314
}],
@@ -337,7 +337,7 @@ fn test_claim_value_force_close() {
337337
// possibly-claimable up to ANTI_REORG_DELAY, at which point it will drop it.
338338
mine_transaction(&nodes[0], &b_broadcast_txn[0]);
339339
expect_payment_sent!(nodes[0], payment_preimage);
340-
assert_eq!(vec![ClaimableBalance::PossiblyClaimableHTLCAwaitingTimeout {
340+
assert_eq!(vec![ClaimableBalance::MaybeClaimableHTLCAwaitingTimeout {
341341
claimable_amount_satoshis: 3_000,
342342
claimable_height: htlc_cltv_timeout,
343343
}],

0 commit comments

Comments
 (0)