-
Notifications
You must be signed in to change notification settings - Fork 26
Include funding amounts in channel announcements #102
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
Conversation
This is the server-side changeset for addressing lightningdevkit/rust-lightning#1559
I've assigned @jkczyz as a reviewer! |
let mut node_id_b_index = node_id_b_index as u64; | ||
if version >= 2 { | ||
// Set the "extra data" bit so that we can write the funding amount below. | ||
node_id_b_index |= 1 << 63; |
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.
Does the client reset this bit when looking up the node id?
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.
@@ -279,7 +280,19 @@ pub fn serialize_stripped_channel_announcement(announcement: &UnsignedChannelAnn | |||
|
|||
// write indices of node ids rather than the node IDs themselves | |||
BigSize(node_id_a_index as u64).write(&mut stripped_announcement).unwrap(); | |||
BigSize(node_id_b_index as u64).write(&mut stripped_announcement).unwrap(); | |||
|
|||
let mut node_id_b_index = node_id_b_index as u64; |
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 take it we'll always use the second node index for indicating extra data follows?
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.
Neither `channel_announcement`s nor `channel_update`s contain a channel's actual funding amount, complicating scoring as nodes may set an `htlc_maximum_msat` to something less than the funding amount. When scoring, we use `htlc_maximum_msat` anyway if we don't know the funding amount, but its not a perfect proxy. In lightningdevkit/rapid-gossip-sync-server#102 we started including a channel's real funding amount in RGS data, and here we start parsing it and including it in our network graph.
Neither `channel_announcement`s nor `channel_update`s contain a channel's actual funding amount, complicating scoring as nodes may set an `htlc_maximum_msat` to something less than the funding amount. When scoring, we use `htlc_maximum_msat` anyway if we don't know the funding amount, but its not a perfect proxy. In lightningdevkit/rapid-gossip-sync-server#102 we started including a channel's real funding amount in RGS data, and here we start parsing it and including it in our network graph. Fixes lightningdevkit#1559
Neither `channel_announcement`s nor `channel_update`s contain a channel's actual funding amount, complicating scoring as nodes may set an `htlc_maximum_msat` to something less than the funding amount. When scoring, we use `htlc_maximum_msat` anyway if we don't know the funding amount, but its not a perfect proxy. In lightningdevkit/rapid-gossip-sync-server#102 we started including a channel's real funding amount in RGS data, and here we start parsing it and including it in our network graph. Fixes lightningdevkit#1559
Neither `channel_announcement`s nor `channel_update`s contain a channel's actual funding amount, complicating scoring as nodes may set an `htlc_maximum_msat` to something less than the funding amount. When scoring, we use `htlc_maximum_msat` anyway if we don't know the funding amount, but its not a perfect proxy. In lightningdevkit/rapid-gossip-sync-server#102 we started including a channel's real funding amount in RGS data, and here we start parsing it and including it in our network graph. Fixes lightningdevkit#1559
This is the server-side changeset for addressing
lightningdevkit/rust-lightning#1559