Skip to content

Bug: balance reported by /channels disagrees with what LND checks in payinvoice #4585

@Kixunil

Description

@Kixunil

Background

Paying an invoice can fail with "insufficient balance" even if the local balance (with channel reserve subtracted) reported by /channel is higher than amount in the invoice.

Python code calculating the balance

Your environment

  • version of lnd: 0.11.0
  • which operating system (uname -a on *Nix) :Linux disp7952 4.19.132-1.pvops.qubes.x86_64 #1 SMP Tue Jul 14 03:42:21 UTC 2020 x86_64 GNU/Linux
  • version of btcd, bitcoind, or other backend: Bitcoin Core version v0.20.0
  • any other relevant environment details: regtest

Steps to reproduce

  1. Setup two regtest LN nodes and a bitcoind node
  2. Create (and confirm) a 40000 sat channel from A to B
  3. Create a 20000 sat invoice at node B and pay it from node A
  4. Get balance of the channel
  5. Create a 10000 sat invoice and attempt to pay it from A

Expected behaviour

Either balance is reported to be lower than the invoice amount or the payment succeeds.

Actual behaviour

The reported balance is 10337, yet paying a 10000 sat invoice fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions