Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andiz2 committed Apr 22, 2024
1 parent 7af1957 commit d0569d3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lnrpc/lightning.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lnwire/short_channel_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func (c ShortChannelID) String() string {
return fmt.Sprintf("%d:%d:%d", c.BlockHeight, c.TxIndex, c.TxPosition)
}

// String generates a human-readable representation of the channel ID with 'x' instead of ':'.
func (c ShortChannelID) StringX() string {
return fmt.Sprintf("%dx%dx%d", c.BlockHeight, c.TxIndex, c.TxPosition)
}

// Record returns a TLV record that can be used to encode/decode a
// ShortChannelID to/from a TLV stream.
func (c *ShortChannelID) Record() tlv.Record {
Expand Down
2 changes: 2 additions & 0 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4405,6 +4405,8 @@ func createRPCOpenChannel(r *rpcServer, dbChannel *channeldb.OpenChannel,
RemotePubkey: nodeID,
ChannelPoint: chanPoint.String(),
ChanId: dbScid.ToUint64(),
ChannelID: chanID,
ShortChannelIdStringX: dbScid.StringX(),
Capacity: int64(dbChannel.Capacity),
LocalBalance: int64(localBalance.ToSatoshis()),
RemoteBalance: int64(remoteBalance.ToSatoshis()),
Expand Down

0 comments on commit d0569d3

Please sign in to comment.