mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
Merge pull request #1872 from Roasbeef/create-proper-buckets
channeldb: fix bucket creation hierarchy in createChannelDB
This commit is contained in:
commit
d050cedd02
@ -70,12 +70,6 @@ var (
|
||||
// channel closure. This key should be accessed from within the
|
||||
// sub-bucket of a target channel, identified by its channel point.
|
||||
revocationLogBucket = []byte("revocation-log-key")
|
||||
|
||||
// fwdPackageLogBucket is a bucket that stores the locked-in htlcs after
|
||||
// having received a revocation from the remote party. The keys in this
|
||||
// bucket represent the remote height at which these htlcs were
|
||||
// accepted.
|
||||
fwdPackageLogBucket = []byte("fwd-package-log-key")
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -201,29 +201,63 @@ func createChannelDB(dbPath string) error {
|
||||
if _, err := tx.CreateBucket(openChannelBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := tx.CreateBucket(closedChannelBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := tx.CreateBucket(forwardingLogBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := tx.CreateBucket(fwdPackagesKey); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := tx.CreateBucket(invoiceBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := tx.CreateBucket(paymentBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := tx.CreateBucket(nodeInfoBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := tx.CreateBucket(nodeBucket); err != nil {
|
||||
nodes, err := tx.CreateBucket(nodeBucket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := tx.CreateBucket(edgeBucket); err != nil {
|
||||
_, err = nodes.CreateBucket(aliasIndexBucket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := tx.CreateBucket(edgeIndexBucket); err != nil {
|
||||
_, err = nodes.CreateBucket(nodeUpdateIndexBucket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := tx.CreateBucket(graphMetaBucket); err != nil {
|
||||
|
||||
edges, err := tx.CreateBucket(edgeBucket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := edges.CreateBucket(edgeIndexBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := edges.CreateBucket(edgeUpdateIndexBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := edges.CreateBucket(channelPointBucket); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
graphMeta, err := tx.CreateBucket(graphMetaBucket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = graphMeta.CreateBucket(pruneLogBucket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user