channeldb: add ShortChanID to close channel summary
This commit is contained in:
parent
5d7119fe9c
commit
b4fc34a93a
@ -1249,6 +1249,11 @@ type ChannelCloseSummary struct {
|
|||||||
// and is used as a unique identifier for the channel.
|
// and is used as a unique identifier for the channel.
|
||||||
ChanPoint wire.OutPoint
|
ChanPoint wire.OutPoint
|
||||||
|
|
||||||
|
// ShortChanID encodes the exact location in the chain in which the
|
||||||
|
// channel was initially confirmed. This includes: the block height,
|
||||||
|
// transaction index, and the output within the target transaction.
|
||||||
|
ShortChanID lnwire.ShortChannelID
|
||||||
|
|
||||||
// ChainHash is the hash of the genesis block that this channel resides
|
// ChainHash is the hash of the genesis block that this channel resides
|
||||||
// within.
|
// within.
|
||||||
ChainHash chainhash.Hash
|
ChainHash chainhash.Hash
|
||||||
@ -1293,8 +1298,6 @@ type ChannelCloseSummary struct {
|
|||||||
// closed, they'll stay marked as "pending" until _all_ the pending
|
// closed, they'll stay marked as "pending" until _all_ the pending
|
||||||
// funds have been swept.
|
// funds have been swept.
|
||||||
IsPending bool
|
IsPending bool
|
||||||
|
|
||||||
// TODO(roasbeef): also store short_chan_id?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloseChannel closes a previously active Lightning channel. Closing a channel
|
// CloseChannel closes a previously active Lightning channel. Closing a channel
|
||||||
@ -1452,8 +1455,8 @@ func putChannelCloseSummary(tx *bolt.Tx, chanID []byte,
|
|||||||
|
|
||||||
func serializeChannelCloseSummary(w io.Writer, cs *ChannelCloseSummary) error {
|
func serializeChannelCloseSummary(w io.Writer, cs *ChannelCloseSummary) error {
|
||||||
return writeElements(w,
|
return writeElements(w,
|
||||||
cs.ChanPoint, cs.ChainHash, cs.ClosingTXID, cs.CloseHeight,
|
cs.ChanPoint, cs.ShortChanID, cs.ChainHash, cs.ClosingTXID,
|
||||||
cs.RemotePub, cs.Capacity, cs.SettledBalance,
|
cs.CloseHeight, cs.RemotePub, cs.Capacity, cs.SettledBalance,
|
||||||
cs.TimeLockedBalance, cs.CloseType, cs.IsPending,
|
cs.TimeLockedBalance, cs.CloseType, cs.IsPending,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -1479,8 +1482,8 @@ func deserializeCloseChannelSummary(r io.Reader) (*ChannelCloseSummary, error) {
|
|||||||
c := &ChannelCloseSummary{}
|
c := &ChannelCloseSummary{}
|
||||||
|
|
||||||
err := readElements(r,
|
err := readElements(r,
|
||||||
&c.ChanPoint, &c.ChainHash, &c.ClosingTXID, &c.CloseHeight,
|
&c.ChanPoint, &c.ShortChanID, &c.ChainHash, &c.ClosingTXID,
|
||||||
&c.RemotePub, &c.Capacity, &c.SettledBalance,
|
&c.CloseHeight, &c.RemotePub, &c.Capacity, &c.SettledBalance,
|
||||||
&c.TimeLockedBalance, &c.CloseType, &c.IsPending,
|
&c.TimeLockedBalance, &c.CloseType, &c.IsPending,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user