Merge pull request #5834 from torkelrogstad/2021-10-06-getchaininfo

lncli: take chan_id as uint64 in getchaninfo
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2021-10-07 12:49:44 -07:00
commit 935fd267a0
2 files changed
+9 -5

No files matched your search

+5 -5
View File
@@ -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)
@@ -446,6 +446,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