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
- Setup two regtest LN nodes and a bitcoind node
- Create (and confirm) a 40000 sat channel from A to B
- Create a 20000 sat invoice at node B and pay it from node A
- Get balance of the channel
- 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.