-
Notifications
You must be signed in to change notification settings - Fork 409
Add optional user specified channel limits of bolt 2 #169
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
Add optional user specified channel limits of bolt 2 #169
Conversation
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.
There's a few whitespace things I didn't mark, but if you do git show it should highlight them for you. Also, best to avoid merge commits in pull requests, its easier to keep track of where things are in the eventual git log if you rebase instead.
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.
Needs rebase. Note that you may also want to set your editor to highlight extra whitespace at EOLs, since you've got that in a few places, though I'm generally fine cleaning up whitespace errors during merge.
653f418
to
9a3e171
Compare
f423a15
to
99b1c24
Compare
ecaa1a2
to
86c84ed
Compare
Why not something like TheBlueMatt@96889fd instead of all of the per-Channel storage just to get the announced_channel flag? |
mmm that could work as well. This is why I put the annouce channel and fee_proportional_millionths in the config: #169 (comment) I liked the idea of storing as much as possible in a "config" as I believe this makes the code easier to read, but both will work just as well. But not even storing a reference to the limits removes the issue of using an ARC or lifetimes which solves one problem we have. |
7b75169
to
6c72a35
Compare
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.
There's a bunch of out-of-date docs in configurations.rs that should be rewritten for the latest version of this PR. Also, it may make sense to shorten some names as Configuration/Configurations in needlessly long - Config is equally descriptive and much shorter, generally.
6c72a35
to
0bb08f5
Compare
src/ln/channel.rs
Outdated
// TODO: We should refactor this to be an Inbound/OutboundChannel until initial setup handshaking | ||
// has been completed, and then turn into a Channel to get compiler-time enforcement of things like | ||
// calling channel_id() before we're set up or things like get_outbound_funding_signed on an | ||
// inbound channel. | ||
pub(super) struct Channel { | ||
pub config : ChannelConfig, |
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.
Hmm, I feel awkward making this pub - we cant change announce_publicly at runtime and it would also be the only field not hidden behind accessors.
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.
Cool, code looks good, but the docs here aren't really at all informative, they read more just like "had to add a doc, so wrote the variable name" in a few places, whereas especially for configuration nobs we really need to be descriptive and tell users what is going on.
26a8e5f
to
39c2e7b
Compare
b163b89
to
17b7611
Compare
35b1eb2
to
b57407a
Compare
Will take as #234. |
Added a config struct to use when passing configurations into the channel.
Before accepting a channel the channel will test optional limits as specified by BOLT 2.
The default values of these test are set to not test the limits, but the user can supply other values.