Description
Background
When using anchor-channels a minimum reserved wallet balance is required (10_000 sats/channel; maximum 100_000 sats).
When the node has some anchor-channel open and only a single UTXO in the wallet, then calling SendCoins
or SendMany
to send some on-chain funds out is impossible as it returns the error reserved wallet balance invalidated
, even though we send out an amount that would leave sufficient funds on the node.
However, it is still possible to call OpenChannel
to open a channel as long as we fund it with an amount that leaves enough on-chain funds for the reserved wallet balance.
As a work-around it is possible to request a new address on the node and then use SendCoins
or SendMany
to actively send an amount equal to (or greater than) the required reserved wallet balance to your own address. This splits the UTXO and makes it possible to now send funds out again.
It therefore seems that the problem is that the check for reserved wallet balance is done without knowledge of a change output using SendCoins
/SendMany
, while this is known when opening a new channel with OpenChannel
?
Your environment
- version of
lnd
: 0.13.0/0.13.1 - which operating system (
uname -a
on *Nix): linux
Steps to reproduce
- Create a new node.
- Generate a new address and send funds to this address.
- From the node open an anchor-channel to some remote. Now all of the on-chain funds are in a single UTXO, which are un-spendable using
SendCoins
/SendMany
when trying to send to an external address (even though the transaction would leave sufficient funds for the wallet reserve on the node). - It is still possible to open channels and to split the UTXO when actively sending funds to your own address requested via
newaddress
.
Expected behaviour
It should be possible to detect that the change output of a transaction from SendCoins
/SendMany
would leave sufficient wallet reserve funds.
Actual behaviour
The error reserved wallet balance invalidated
is returned.