Skip to content

Commit 2285bf9

Browse files
committed
Add TODOs and known bugs
1 parent f331ac9 commit 2285bf9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ struct PeerState {
359359
/// For users who don't want to bother doing their own payment preimage storage, we also store that
360360
/// here.
361361
struct PendingInboundPayment {
362+
//XXX: IMPLEMENT time outs, note that we MUST also fail any claimable_htlcs when we do so!
362363
/// The payment secret which the sender must use for us to accept this payment
363364
payment_secret: PaymentSecret,
364365
/// Arbitrary identifier the user specifies (or not)
@@ -1974,6 +1975,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
19741975
hash_map::Entry::Occupied(inbound_payment) => {
19751976
if inbound_payment.get().payment_secret != payment_data.payment_secret {
19761977
log_trace!(self.logger, "Failing new HTLC with payment_hash {} as it didn't match our expected payment secret.", log_bytes!(payment_hash.0));
1978+
// XXX: We don't handle this identically here! There is a
1979+
// second PendingHTLCsForwardable event instead of an immediate
1980+
// claim, which is incorrect?
19771981
fail_htlc!(claimable_htlc);
19781982
} else if inbound_payment.get().min_value_msat.is_some() && inbound_payment.get().min_value_msat.unwrap() > payment_data.total_msat {
19791983
log_trace!(self.logger, "Failing new HTLC with payment_hash {} as it didn't match our minimum value (had {}, needed {}).",

lightning/src/ln/functional_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7505,6 +7505,7 @@ fn test_check_htlc_underpaying() {
75057505
commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
75067506
expect_pending_htlcs_forwardable!(nodes[1]);
75077507

7508+
expect_pending_htlcs_forwardable!(nodes[1]); //XXX
75087509
// Node 3 is expecting payment of 100_000 but received 10_000,
75097510
// it should fail htlc like we didn't know the preimage.
75107511
nodes[1].node.process_pending_htlc_forwards();

0 commit comments

Comments
 (0)