-
Notifications
You must be signed in to change notification settings - Fork 375
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
Trampoline Payload Construction Method #3386
base: main
Are you sure you want to change the base?
Changes from all commits
cec4473
b2cad2f
f403137
4228c8d
106e1cc
1939205
9ad4171
eb5dcfd
f88778e
549fdd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -668,7 +668,7 @@ impl HTLCSource { | |
pub fn dummy() -> Self { | ||
assert!(cfg!(not(feature = "grind_signatures"))); | ||
HTLCSource::OutboundRoute { | ||
path: Path { hops: Vec::new(), blinded_tail: None }, | ||
path: Path { hops: Vec::new(), trampoline_hops: Vec::new(), blinded_tail: None }, | ||
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. nit: every other vec in this patch is initialized with 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. oh, good point! 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. ah, actually, the other element had already been initialized with Vec::new(), so I think that's more consistent in this instance |
||
session_priv: SecretKey::from_slice(&[1; 32]).unwrap(), | ||
first_hop_htlc_msat: 0, | ||
payment_id: PaymentId([2; 32]), | ||
|
@@ -12594,7 +12594,7 @@ impl Readable for HTLCSource { | |
// instead. | ||
payment_id = Some(PaymentId(*session_priv.0.unwrap().as_ref())); | ||
} | ||
let path = Path { hops: path_hops, blinded_tail }; | ||
let path = Path { hops: path_hops, trampoline_hops: vec![], blinded_tail }; | ||
if path.hops.len() == 0 { | ||
return Err(DecodeError::InvalidValue); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to understand how types get assigned in LDK - it's an optional field here so shouldn't it have an odd type value ? thanks for clarifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those concepts are a bit orthogonal. Even means if it's present, you cannot ignore it, i.e. you have to understand how to parse it, whereas odd means it's fine to just skip that value if you don't know what to do with it.
Optional means that the value may not need to be set. So you can have optional even fields like here, where there may not be a value, but if there is one, it's important to understand it correctly.
The only scenario I cannot really think of a good use case for is required odd fields, which would suggest that the value must always be present, but is fine to skip when parsing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you I understand now.