Skip to content

Commit b197bf7

Browse files
committed
XXX: Take note of some consistency failures
1 parent 1caae7c commit b197bf7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
19911991
hash_map::Entry::Occupied(inbound_payment) => {
19921992
if inbound_payment.get().payment_secret != payment_data.payment_secret {
19931993
log_trace!(self.logger, "Failing new HTLC with payment_hash {} as it didn't match our expected payment secret.", log_bytes!(payment_hash.0));
1994+
// XXX: We don't handle this identically here! There is a
1995+
// second PendingHTLCsForwardable event instead of an immediate
1996+
// claim, which is incorrect?
19941997
fail_htlc!(claimable_htlc);
19951998
} else if inbound_payment.get().min_value_msat.is_some() && payment_data.total_msat < inbound_payment.get().min_value_msat.unwrap() {
19961999
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
@@ -7506,6 +7506,7 @@ fn test_check_htlc_underpaying() {
75067506
commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false);
75077507
expect_pending_htlcs_forwardable!(nodes[1]);
75087508

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

0 commit comments

Comments
 (0)