mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-29 17:19:33 +02:00
lnwire: add 'x' separator in ShortChannelID method
Add the `AltString` method for `ShortChannelID` to produce a human-readable format with 'x' as a separator (block x transaction x output). Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
This commit is contained in:
parent
a388c1f39d
commit
7f8e89f3b4
@ -56,6 +56,12 @@ func (c ShortChannelID) String() string {
|
||||
return fmt.Sprintf("%d:%d:%d", c.BlockHeight, c.TxIndex, c.TxPosition)
|
||||
}
|
||||
|
||||
// AltString generates a human-readable representation of the channel ID
|
||||
// with 'x' as a separator.
|
||||
func (c ShortChannelID) AltString() 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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user