channeldb: MigrateOutpointIndex, store indexStatus in outpoint index

Adds an outpoint index that stores a tlv stream. Currently the stream
only contains the outpoint's indexStatus. This should cut down on
big bbolt transactions in several places throughout the codebase.
This commit is contained in:
eugene authored and Conner Fromknecht committed 2020-12-10 17:37:59 -08:00
1 parent 08ee754a6d
commit 204b6c51cf
5 files changed
+354 -5

No files matched your search

+13
View File
@@ -17,6 +17,7 @@ import (
"github.com/lightningnetwork/lnd/channeldb/migration12"
"github.com/lightningnetwork/lnd/channeldb/migration13"
"github.com/lightningnetwork/lnd/channeldb/migration16"
"github.com/lightningnetwork/lnd/channeldb/migration20"
"github.com/lightningnetwork/lnd/channeldb/migration_01_to_11"
"github.com/lightningnetwork/lnd/clock"
"github.com/lightningnetwork/lnd/lnwire"
@@ -170,6 +171,17 @@ var (
number: 18,
migration: mig.CreateTLB(peersBucket),
},
{
// Create a top level bucket which holds outpoint
// information.
number: 19,
migration: mig.CreateTLB(outpointBucket),
},
{
// Migrate some data to the outpoint index.
number: 20,
migration: migration20.MigrateOutpointIndex,
},
}
// Big endian is the preferred byte order, due to cursor scans over
@@ -309,6 +321,7 @@ var topLevelBuckets = [][]byte{
graphMetaBucket,
metaBucket,
closeSummaryBucket,
outpointBucket,
}
// Wipe completely deletes all saved state within all used buckets within the