Skip to content
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

Provide local balance msat value in ChannelForceClosed #1898

Closed
TheBlueMatt opened this issue Dec 4, 2022 · 26 comments
Closed

Provide local balance msat value in ChannelForceClosed #1898

TheBlueMatt opened this issue Dec 4, 2022 · 26 comments
Labels
good first issue Good for newcomers
Milestone

Comments

@TheBlueMatt
Copy link
Collaborator

For accounting purposes, its nice to know what your local balance was when a channel was force-closed. This would allow you to see how many msat you lost to rounding.

@TheBlueMatt TheBlueMatt added the good first issue Good for newcomers label Dec 4, 2022
@TheBlueMatt TheBlueMatt added this to the 0.1.1 milestone Dec 4, 2022
@Cxxshyy
Copy link

Cxxshyy commented Dec 8, 2022

if i could get some guidance i'd like to do this issue

@TheBlueMatt
Copy link
Collaborator Author

Basically add a new field last_local_balance_msat or something like that, to the ChannelClosed event, and then fix all the compile errors where we generate that event by calling Channel::get_available_balances and including the balance_msat field.

@Cxxshyy
Copy link

Cxxshyy commented Dec 14, 2022

@TheBlueMatt ok will have a shot but will ask a lot since i'm still new to rust

@Cxxshyy
Copy link

Cxxshyy commented Dec 16, 2022

first question is what file handles the channel close event @TheBlueMatt

@tnull
Copy link
Contributor

tnull commented Dec 16, 2022

first question is what file handles the channel close event @TheBlueMatt

You can find this event type in the documentation: https://docs.rs/lightning/latest/lightning/util/events/enum.Event.html#variant.ChannelClosed

@Sharmalm
Copy link
Contributor

Hii,
I want to do this issue, and I am new to rust, so I will need some help.
I think this file handles channel close event :
https://github.com/lightningdevkit/rust-lightning/blob/main/lightning/src/ln/channel.rs
Am i correct ?

@Sharmalm
Copy link
Contributor

Sorry I think this file handles channel close event:
https://github.com/lightningdevkit/rust-lightning/blob/main/lightning/src/ln/channelmanager.rs
@tnull Am correct ?

@TheBlueMatt
Copy link
Collaborator Author

You should start by updating the event itself in events.rs and compile, that will give you a list of places that need updating :)

@Cxxshyy
Copy link

Cxxshyy commented Jan 3, 2023

ok thanks

@Cxxshyy
Copy link

Cxxshyy commented Jan 3, 2023

what should the type be for last_local_balance_msat field @TheBlueMatt

@valentinewallace
Copy link
Contributor

valentinewallace commented Jan 3, 2023

what should the type be for last_local_balance_msat field @TheBlueMatt

@Cxxshyy should be u64!

@Cxxshyy
Copy link

Cxxshyy commented Jan 3, 2023

ok thanks

what should the type be for last_local_balance_msat field @TheBlueMatt

@Cxxshyy should be u64!

@Sharmalm
Copy link
Contributor

Sharmalm commented Jan 4, 2023

Hey everyone, I'm new opensource, but there are some issues I don't understand and the ones I do are already assigned to someone.
i would like to to give a try on this issue ,so @Cxxshyy can i work with you on this issue? :)

@Cxxshyy
Copy link

Cxxshyy commented Jan 4, 2023

@Lalitmohansharma1 hey man sorry i dont think this issue is big enough for 2 people to work on.

@Cxxshyy
Copy link

Cxxshyy commented Jan 4, 2023

also
image
for this function here would i need to create a new function to obtain the local balance

@Sharmalm
Copy link
Contributor

Sharmalm commented Jan 5, 2023

@Lalitmohansharma1 hey man sorry i dont think this issue is big enough for 2 people to work on.

Ok :)

@valentinewallace
Copy link
Contributor

also image for this function here would i need to create a new function to obtain the local balance

Does this comment answer that: #1898 (comment) so just use Channel::get_available_balances?

@Cxxshyy
Copy link

Cxxshyy commented Jan 5, 2023

also image for this function here would i need to create a new function to obtain the local balance

Does this comment answer that: #1898 (comment) so just use Channel::get_available_balances?

on it thanks

@Cxxshyy
Copy link

Cxxshyy commented Jan 5, 2023

pub fn get_available_balances(&self) -> AvailableBalances this is the function signature where availableBalances is a struct however localBal is an u64 so how can i satisfy this when i call the function
image

@TheBlueMatt
Copy link
Collaborator Author

Use the relevant (local balance) field from it :)

@Cxxshyy
Copy link

Cxxshyy commented Jan 6, 2023

ok i think i might have completed it now

@Cxxshyy
Copy link

Cxxshyy commented Jan 6, 2023

nvm but close

@freddiekrugerrand
Copy link
Contributor

@Cxxshyy / @BOLT-12 either of you actively working on this? Would be interested in picking it up if it's free.

@srikanth-iyengar
Copy link

Hey @TheBlueMatt I would like to work on this issue, is this up for grabs ?

@TheBlueMatt
Copy link
Collaborator Author

Looks like it, its been a few months since the last comment.

@Mirebella
Copy link
Contributor

Is this good to close, given that #3235 was merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

8 participants