Skip to content

Commit 7c42921

Browse files
committed
Add log when user rejected payment
1 parent 31a5340 commit 7c42921

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ln/channelmanager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,12 @@ impl ChannelManager {
14451445
if let Some(mut sources) = removed_source {
14461446
for htlc_with_hash in sources.drain(..) {
14471447
if channel_state.is_none() { channel_state = Some(self.channel_state.lock().unwrap()); }
1448+
log_info!(self, "User rejected the incoming HTLC: {}", {
1449+
match reason {
1450+
PaymentFailReason::PreimageUnknown => "Preimage is unknown",
1451+
PaymentFailReason::AmountMismatch => "Amount mismatch",
1452+
}
1453+
});
14481454
self.fail_htlc_backwards_internal(channel_state.take().unwrap(), HTLCSource::PreviousHopData(htlc_with_hash), payment_hash, HTLCFailReason::Reason { failure_code: if reason == PaymentFailReason::PreimageUnknown {0x4000 | 15} else {0x4000 | 16}, data: Vec::new() });
14491455
}
14501456
true

0 commit comments

Comments
 (0)