Open
Description
Background
When opening an anchor channel using all or nearly all of your wallet balance, you get an error message from lncli:
$ lncli openchannel --node_key 03ff1efa980a8b608233a2656ff77f9b5f45df0a0f9a58c7bdfbf6411d4e6fec91 --local_amt 29807
[lncli] rpc error: code = Unknown desc = reserved wallet balance invalidated: transaction would leave insufficient funds for fee bumping anchor channel closings (see debug log for details)
This error message doesn't indicate how much additional balance is required to open the channel. When checking the debug log for detail, there's still no info on the additional balance:
2022-05-03 17:35:05.565 [DBG] LNWL: Estimated fee rate of 250 sat/kw sat/kw is too low, using fee floor of 253 sat/kw sat/kw instead
2022-05-03 17:35:05.565 [DBG] LNWL: Returning 253 sat/kw for conf target of 6
2022-05-03 17:35:05.565 [DBG] RPCS: [openchannel]: using fee of 253 sat/kw for funding tx
2022-05-03 17:35:05.565 [INF] FNDG: Initiating fundingRequest(local_amt=0.00029807 BTC (subtract_fees=false), push_amt=0 mSAT, chain_hash=00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6, peer=03ff1efa980a8b608233a2656ff77f9b5f45df0a0f9a58c7bdfbf6411d4e6fec91, min_confs=1)
2022-05-03 17:35:05.565 [DBG] LNWL: Estimated fee rate of 250 sat/kw sat/kw is too low, using fee floor of 253 sat/kw sat/kw instead
2022-05-03 17:35:05.565 [DBG] LNWL: Returning 253 sat/kw for conf target of 3
2022-05-03 17:35:05.565 [INF] CHFD: Performing funding tx coin selection using 253 sat/kw as fee rate
2022-05-03 17:35:05.565 [WRN] CHFD: Unable to find funding output for shim intent: unable to create witness script, no funding keys
2022-05-03 17:35:05.566 [DBG] LNWL: Reserved value=0.0001 BTC above final walletbalance=0 BTC with 1 anchor channels open
2022-05-03 17:35:05.566 [ERR] RPCS: unable to open channel to NodeKey(03ff1efa980a8b608233a2656ff77f9b5f45df0a0f9a58c7bdfbf6411d4e6fec91): reserved wallet balance invalidated: transaction would leave insufficient funds for fee bumping anchor channel closings (see debug log for details)
2022-05-03 17:35:05.566 [ERR] RPCS: [/lnrpc.Lightning/OpenChannel]: reserved wallet balance invalidated: transaction would leave insufficient funds for fee bumping anchor channel closings (see debug log for details)
Your environment
lnd
0.14.2
Expected behaviour
The amount of the shortage of wallet funds should be included in the error message and/or logs to help the user make a successful channel opening without having to "guess" the max channel size.