Skip to content

Relax fundChannel checks on CLI for parity with RPC functionality #1142

@dstadulis

Description

@dstadulis

Description:

Recent node operations revealed the fundChannel command in the CLI has an outdated sanity check that requires a single UTXO to contain enough for the channel funding attempt. However, this check is no longer relevant and was removed from the RPC calls.

The RPC calls were updated to allow composite UTXOs (assets from multiple asset utxos) for funding capability, but the same functionality is not available in the CLI due to the existing sanity check.

Errant Code:

The code that implements this sanity check can be found at:
https://github.com/lightninglabs/lightning-terminal/blob/648648410b9ea91b65c3a3c6de5b23654c90e2a5/cmd/litcli/ln.go#L122-L139

Specifically, the code checks if a single UTXO with at least the requested amount is available:

if !assetFound {
	return fmt.Errorf("asset with ID %x not found or no UTXO with "+
		"at least amount %d is available", assetIDBytes,
		requestedAmount)
}

This "no UTXO with at least amount " results in an error message when trying to fund a channel with composite UTXOs.

Expected Behavior:

The CLI should allow funding channels with composite UTXOs, with equivalent functionality to RPC calls. The CLI sanity check should be relaxed to allow this functionality.

Steps to Reproduce:

Try to fund a channel using the fundChannel command in the CLI.
Use composite UTXOs (assets from multiple asset utxos) to fund a channel of size in excess of any one of the utxos.
Observe the error message "no UTXO with at least amount".

Commit History:

The RPC calls were updated to allow composite UTXOs in [TODO: insert commit hash]. However, the same functionality was not updated in the CLI.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions