-
Notifications
You must be signed in to change notification settings - Fork 417
Hold times for successful payments #3801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joostjager
wants to merge
12
commits into
lightningdevkit:main
Choose a base branch
from
joostjager:fulfill-hold-times
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1ed3121
Rustfmt parts of channel.rs and channelmanager.rs
joostjager c6d6561
Rustfmt touch ups
joostjager 483d97b
Small refactors in onion_utils
joostjager b19f911
Extract hold time calculation
joostjager 7947c0d
Add AttributionData to UpdateFulfillHTLC message
joostjager 55e9449
Add AttributionData to InboundHTLCRemovalReason::Fulfill
joostjager d8ae3d0
Add AttributionData to HTLCUpdateAwaitingACK::ClaimHTLC
joostjager 4861747
Hold time reporting
joostjager 526e9aa
Remove code duplication in FundedChannel::read
joostjager 1da5cd2
Add AttributionData to OutboundHTLCOutcome::Success
joostjager 2b18bf6
Return path events from expect_payment_sent
joostjager 23f5273
Decode hold times as a sender
joostjager File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2887,8 +2887,12 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f | |
as_raa = Some(get_event_msg!(nodes[0], MessageSendEvent::SendRevokeAndACK, node_b_id)); | ||
} | ||
|
||
let fulfill_msg = | ||
msgs::UpdateFulfillHTLC { channel_id: chan_id_2, htlc_id: 0, payment_preimage }; | ||
let mut fulfill_msg = msgs::UpdateFulfillHTLC { | ||
channel_id: chan_id_2, | ||
htlc_id: 0, | ||
payment_preimage, | ||
attribution_data: None, | ||
}; | ||
if second_fails { | ||
nodes[2].node.fail_htlc_backwards(&payment_hash); | ||
expect_pending_htlcs_forwardable_and_htlc_handling_failed!( | ||
|
@@ -2897,15 +2901,24 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f | |
); | ||
check_added_monitors!(nodes[2], 1); | ||
get_htlc_update_msgs!(nodes[2], node_b_id); | ||
// Note that we don't populate fulfill_msg.attribution_data here, which will lead to hold times being | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rustfmt 🤷♂️ |
||
// unavailable. | ||
} else { | ||
nodes[2].node.claim_funds(payment_preimage); | ||
check_added_monitors!(nodes[2], 1); | ||
expect_payment_claimed!(nodes[2], payment_hash, 100_000); | ||
|
||
let cs_updates = get_htlc_update_msgs!(nodes[2], node_b_id); | ||
assert_eq!(cs_updates.update_fulfill_htlcs.len(), 1); | ||
// Check that the message we're about to deliver matches the one generated: | ||
assert_eq!(fulfill_msg, cs_updates.update_fulfill_htlcs[0]); | ||
|
||
// Check that the message we're about to deliver matches the one generated. Ignore attribution data. | ||
assert_eq!(fulfill_msg.channel_id, cs_updates.update_fulfill_htlcs[0].channel_id); | ||
assert_eq!(fulfill_msg.htlc_id, cs_updates.update_fulfill_htlcs[0].htlc_id); | ||
assert_eq!( | ||
fulfill_msg.payment_preimage, | ||
cs_updates.update_fulfill_htlcs[0].payment_preimage | ||
); | ||
fulfill_msg.attribution_data = cs_updates.update_fulfill_htlcs[0].attribution_data.clone(); | ||
} | ||
nodes[1].node.handle_update_fulfill_htlc(node_c_id, &fulfill_msg); | ||
expect_payment_forwarded!(nodes[1], nodes[0], nodes[2], Some(1000), false, false); | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.