Skip to content

Commit 466d9c2

Browse files
committed
Add TODOs and known bugs
1 parent 22a83d2 commit 466d9c2

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ struct PeerState {
358358
/// For users who don't want to bother doing their own payment preimage storage, we also store that
359359
/// here.
360360
struct PendingInboundPayment {
361+
//XXX: IMPLEMENT time outs, note that we MUST also fail any claimable_htlcs when we do so!
361362
payment_secret: PaymentSecret,
362363
expiry_height: u32,
363364
value_msat: Option<u64>,
@@ -1965,6 +1966,9 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
19651966
} else { true }
19661967
} {
19671968
log_trace!(self.logger, "Failing new HTLC with payment_hash {} as it didn't match our expected payment secret.", log_bytes!(payment_hash.0));
1969+
// XXX: We don't handle this identically here! There is a
1970+
// second PendingHTLCsForwardable event instead of an immediate
1971+
// claim, which is incorrect?
19681972
fail_htlc!(claimable_htlc);
19691973
} else {
19701974
let mut total_value = 0;

lightning/src/ln/functional_tests.rs

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

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

lightning/src/util/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub enum Event {
7070
/// should result in an HTLC fail_backwards.
7171
/// Note that, in any case, this value must be passed as-is to any fail or claim calls as
7272
/// the HTLC index includes this value.
73-
payment_secret: Option<PaymentSecret>,
73+
payment_secret: Option<PaymentSecret>, //XXX: Make this non-Optional
7474
/// The value, in thousandths of a satoshi, that this payment is for. Note that you must
7575
/// compare this to the expected value before accepting the payment (as otherwise you are
7676
/// providing proof-of-payment for less than the value you expected!).

0 commit comments

Comments
 (0)