Skip to content

Commit ccbbb55

Browse files
authored
Merge pull request #865 from lightninglabs/relax-fundchannel-checks
litcli: relax fundchannel checks
2 parents 0b45880 + 2a50a51 commit ccbbb55

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

cmd/litcli/ln.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,23 @@ func fundChannel(c *cli.Context) error {
120120
}
121121

122122
assetFound := false
123+
totalAmount := uint64(0)
123124
for _, rpcAsset := range assets.Assets {
124125
if !bytes.Equal(rpcAsset.AssetGenesis.AssetId, assetIDBytes) {
125126
continue
126127
}
127128

128-
if rpcAsset.Amount < requestedAmount {
129-
continue
129+
totalAmount += rpcAsset.Amount
130+
if totalAmount >= requestedAmount {
131+
assetFound = true
132+
break
130133
}
131-
132-
assetFound = true
133134
}
134135

135136
if !assetFound {
136-
return fmt.Errorf("asset with ID %x not found or no UTXO with "+
137-
"at least amount %d is available", assetIDBytes,
138-
requestedAmount)
137+
return fmt.Errorf("asset with ID %x not found or no combined "+
138+
"UTXOs with at least amount %d is available",
139+
assetIDBytes, requestedAmount)
139140
}
140141

141142
resp, err := tchrpcClient.FundChannel(

docs/release-notes/release-notes-0.13.995.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
### Taproot Assets
2020

2121
* A few bugs related to TAP channel liquidity were fixed, sending very small or
22-
very big asset amounts is now possible. See [tapd PR](https://github.com/lightninglabs/taproot-assets/pull/1120).
23-
* `ListBalances` now supports the `include_leased` flag, which will include leased
24-
asset balances in the response.
22+
very big asset amounts is now possible.
23+
See [tapd PR](https://github.com/lightninglabs/taproot-assets/pull/1120).
24+
* `ListBalances` now supports the `include_leased` flag, which will include
25+
leased asset balances in the response.
26+
* [The sanity checks for `fundchannel` now allow for composite
27+
UTXOs.](https://github.com/lightninglabs/lightning-terminal/pull/865)
2528

2629
# Autopilot
2730

0 commit comments

Comments
 (0)