Skip to content

Commit

Permalink
fakechanbackup: use correct JSON decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Dec 15, 2023
1 parent a5a884b commit 8d28e1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/chantools/fakechanbackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/wire"
"github.com/gogo/protobuf/jsonpb"
"github.com/lightninglabs/chantools/lnd"
"github.com/lightningnetwork/lnd/chanbackup"
"github.com/lightningnetwork/lnd/channeldb"
Expand Down Expand Up @@ -138,8 +137,9 @@ func (c *fakeChanBackupCommand) Execute(_ *cobra.Command, _ []string) error {
return fmt.Errorf("error reading graph JSON file %s: "+
"%v", c.FromChannelGraph, err)
}

graph := &lnrpc.ChannelGraph{}
err = jsonpb.UnmarshalString(string(graphBytes), graph)
err = lnrpc.ProtoJSONUnmarshalOpts.Unmarshal(graphBytes, graph)
if err != nil {
return fmt.Errorf("error parsing graph JSON: %w", err)
}
Expand Down

0 comments on commit 8d28e1b

Please sign in to comment.