mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
lncli: take chan_id as uint64 in getchaninfo
When taking in chan_id as a int64, there are some channels that cannot be givn to lncli because they are out of range for an int64.
This commit is contained in:
parent
ccc03931ad
commit
4d96f31f59
2 changed files with 9 additions and 5 deletions
|
@ -1557,7 +1557,7 @@ var getChanInfoCommand = cli.Command{
|
||||||
"particular channel",
|
"particular channel",
|
||||||
ArgsUsage: "chan_id",
|
ArgsUsage: "chan_id",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.Int64Flag{
|
cli.Uint64Flag{
|
||||||
Name: "chan_id",
|
Name: "chan_id",
|
||||||
Usage: "the 8-byte compact channel ID to query for",
|
Usage: "the 8-byte compact channel ID to query for",
|
||||||
},
|
},
|
||||||
|
@ -1571,15 +1571,15 @@ func getChanInfo(ctx *cli.Context) error {
|
||||||
defer cleanUp()
|
defer cleanUp()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
chanID int64
|
chanID uint64
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case ctx.IsSet("chan_id"):
|
case ctx.IsSet("chan_id"):
|
||||||
chanID = ctx.Int64("chan_id")
|
chanID = ctx.Uint64("chan_id")
|
||||||
case ctx.Args().Present():
|
case ctx.Args().Present():
|
||||||
chanID, err = strconv.ParseInt(ctx.Args().First(), 10, 64)
|
chanID, err = strconv.ParseUint(ctx.Args().First(), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error parsing chan_id: %s", err)
|
return fmt.Errorf("error parsing chan_id: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -1588,7 +1588,7 @@ func getChanInfo(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
req := &lnrpc.ChanInfoRequest{
|
req := &lnrpc.ChanInfoRequest{
|
||||||
ChanId: uint64(chanID),
|
ChanId: chanID,
|
||||||
}
|
}
|
||||||
|
|
||||||
chanInfo, err := client.GetChanInfo(ctxc, req)
|
chanInfo, err := client.GetChanInfo(ctxc, req)
|
||||||
|
|
|
@ -443,6 +443,10 @@ you.
|
||||||
* [Use the change output index when validating the reserved wallet balance for
|
* [Use the change output index when validating the reserved wallet balance for
|
||||||
SendCoins/SendMany calls](https://github.com/lightningnetwork/lnd/pull/5665)
|
SendCoins/SendMany calls](https://github.com/lightningnetwork/lnd/pull/5665)
|
||||||
|
|
||||||
|
* A [bug](https://github.com/lightningnetwork/lnd/pull/5834) has been fixed where
|
||||||
|
certain channels couldn't be passed to `lncli getchaninfo` due to their 8-byte
|
||||||
|
compact ID being too large for an int64.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The [code contribution guidelines have been updated to mention the new
|
The [code contribution guidelines have been updated to mention the new
|
||||||
|
|
Loading…
Add table
Reference in a new issue