Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

fix OwnerBalance calculation #89

Open
NiloCK opened this issue Oct 17, 2023 · 1 comment
Open

fix OwnerBalance calculation #89

NiloCK opened this issue Oct 17, 2023 · 1 comment

Comments

@NiloCK
Copy link
Contributor

NiloCK commented Oct 17, 2023

complete this todo in StateChannelWallet

  async getOwnerBalance(): Promise<number> {
    const walletBalance = await this.getBalance();
    // todo: subtract also the pending HTLCs that target the interface
    return walletBalance - (await this.getIntermediaryBalance());
  }
@geoknee
Copy link
Contributor

geoknee commented Oct 18, 2023

@NiloCK is the idea that "in flight" htlcs (signed into the ledger channel state, but not yet unlocked) should be taken into account for the balances?

If so, I think for the demo it may not be worth doing since htlcs get unlocked so quickly?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants