lightninglabs / lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
MIT License
488 stars 82 forks source link

accounts: address `pendingPayments` issues #762

Closed ViktorTigerstrom closed 3 weeks ago

ViktorTigerstrom commented 1 month ago

This PR addresses two issues with the pendingPayments map handling in the accounts system.

  1. Prior to this PR, we would deduct any pending payments as in-flight payments from an account's total balance when calculating the available balance, even if the pending payments were not initiated by the specific account itself. This PR adds an ID check to only deduct pending payments that are actually associated with the account.
  2. If a payment with status UNKNOWN turns out to be uninitiated, we should remove it from the pendingPayments map. This ensures that the payment is not considered when calculating the in-flight balance for the account.
lightninglabs-deploy commented 3 weeks ago

@viktortigerstrom, remember to re-request review from reviewers when ready

ViktorTigerstrom commented 3 weeks ago

Thanks for the reviews :tada:!

And thanks a lot for the commits that adds tracing @ellemouton 🙏! That'll be really useful.

I've addressed the feedback and added your commits with the latest push @ellemouton!

ellemouton commented 3 weeks ago

i merged https://github.com/lightninglabs/lightning-terminal/pull/763 before addressing the review comments there. And viktor is OOO at the moment so im gonna close this PR and open a new one with these commits along with the addressed review comments.