Skip to content

Include non-permanently connected peers in list_peers() - #95

Merged
tnull merged 2 commits into
lightningdevkit:mainfrom
tnull:2023-05-list-all-peers
Jun 13, 2023
Merged

Include non-permanently connected peers in list_peers()#95
tnull merged 2 commits into
lightningdevkit:mainfrom
tnull:2023-05-list-all-peers

Conversation

@tnull

@tnulltnull commented May 12, 2023

Copy link
Copy Markdown
Collaborator

Closes#62, based on #85

This is a follow-up to #56, as we now are able to include non-permanently connected peers in list_peers().
We also include a number of minor doc fixes as a second commit.

@tnulltnull added this to the 0.1 milestone May 12, 2023
@tnulltnull mentioned this pull request May 12, 2023
47 tasks
@tnull
tnullforce-pushed the 2023-05-list-all-peers branch 4 times, most recently from 1bfbfe2 to 7b6ac82CompareMay 23, 2023 17:34
@tnull

Copy link
Copy Markdown
CollaboratorAuthor

Rebased after #85 landed.

@tnull
tnullforce-pushed the 2023-05-list-all-peers branch from 7b6ac82 to a4da746CompareJune 6, 2023 10:38
@tnull

tnull commented Jun 6, 2023

Copy link
Copy Markdown
CollaboratorAuthor

Rebased on main.

Comment threadsrc/lib.rs Outdated
Comment threadsrc/lib.rs
(Some(con_addr), Some(_stored_addr)) => NetAddress(con_addr),
(None, Some(stored_addr)) => stored_addr,
(Some(con_addr), None) => NetAddress(con_addr),
(None, None) => continue,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would this happen?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we're using lightning-net-tokio and don't support OnionV3 currently, it shouldn't happen. In particular the conn_addr_opt should always be Some. However, I'd rather skip than unwrap here, as it doesn't hurt and is safer if something ever were to change.

Comment threadsrc/types.rs Outdated
/// The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
/// thereafter this is the transaction ID of the funding transaction XOR the funding transaction
/// output).
/// The channel ID (prior to funding transaction generation, this is a random 32 byte

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/32 byte/32-byte

Comment threadsrc/types.rs
/// that if we broadcast a revoked state, our counterparty can punish us by claiming at least
/// this value on chain.
/// The value, in satoshis, of this channel as it appears in the funding output.
pub channel_value_sats: u64,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the plural sats but the singular msat below, it seems.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mh, true. Possibly we should decide one way and clean up all at once. This is however doesn't feel like the right place to do it?

Comment threadsrc/lib.rs Outdated
Comment threadsrc/lib.rs Outdated
@tnull
tnullforce-pushed the 2023-05-list-all-peers branch from 0dfee49 to b10591aCompareJune 13, 2023 16:43

@jkczyzjkczyz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please squash fixups.

@tnull
tnullforce-pushed the 2023-05-list-all-peers branch from b10591a to f562395CompareJune 13, 2023 17:43
@tnull

Copy link
Copy Markdown
CollaboratorAuthor

LGTM. Please squash fixups.

Squashed without further changes.

@tnull
tnull merged commit 56fe49c into lightningdevkit:mainJun 13, 2023
joostjager pushed a commit to joostjager/ldk-node that referenced this pull request Jan 28, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include non-permanently connected peers in list_peers

2 participants

@tnull@jkczyz