diff --git a/channeldb/channel.go b/channeldb/channel.go index d0a288218..e5dc42eab 100644 --- a/channeldb/channel.go +++ b/channeldb/channel.go @@ -2440,12 +2440,20 @@ func deleteOpenChannel(chanBucket *bolt.Bucket, chanPointBytes []byte) error { } +// makeLogKey converts a uint64 into an 8 byte array. func makeLogKey(updateNum uint64) [8]byte { var key [8]byte byteOrder.PutUint64(key[:], updateNum) return key } +// readLogKey parse the first 8- bytes of a byte slice into a uint64. +// +// NOTE: The slice must be at least 8 bytes long. +func readLogKey(b []byte) uint64 { + return byteOrder.Uint64(b) +} + func appendChannelLogEntry(log *bolt.Bucket, commit *ChannelCommitment) error {