channeldb+invoices: use payment addr as primary index

This commit is contained in:
Conner Fromknecht committed 2020-05-26 18:55:27 -07:00
1 parent 3522f09a08
commit cbf71b5452
7 files changed
+286 -34

No files matched your search

+9
View File
@@ -13,6 +13,7 @@ import (
"github.com/btcsuite/btcwallet/walletdb"
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/channeldb/kvdb"
mig "github.com/lightningnetwork/lnd/channeldb/migration"
"github.com/lightningnetwork/lnd/channeldb/migration12"
"github.com/lightningnetwork/lnd/channeldb/migration13"
"github.com/lightningnetwork/lnd/channeldb/migration_01_to_11"
@@ -136,6 +137,13 @@ var (
number: 13,
migration: migration13.MigrateMPP,
},
{
// Initialize payment address index and begin using it
// as the default index, falling back to payment hash
// index.
number: 14,
migration: mig.CreateTLB(payAddrIndexBucket),
},
}
// Big endian is the preferred byte order, due to cursor scans over
@@ -248,6 +256,7 @@ var topLevelBuckets = [][]byte{
forwardingLogBucket,
fwdPackagesKey,
invoiceBucket,
payAddrIndexBucket,
nodeInfoBucket,
nodeBucket,
edgeBucket,