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:
Nishant Bansal 2025-01-15 15:25:40 +05:30
parent a388c1f39d
commit 7f8e89f3b4
No known key found for this signature in database
GPG Key ID: EAE292198F6C5B98

View File

@ -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 {