Skip to content

Commit

Permalink
headerfs/index: clarify that headers are sorted by hash in the db
Browse files Browse the repository at this point in the history
  • Loading branch information
halseth committed Oct 18, 2018
1 parent 66f3cbb commit 960dc9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions headerfs/index.go
Expand Up @@ -99,7 +99,7 @@ type headerEntry struct {

// headerBatch is a batch of header entries to be written to disk.
//
// NOTE: The entries within a batch SHOULD be properly sorted by height in
// NOTE: The entries within a batch SHOULD be properly sorted by hash in
// order to ensure the batch is written in a sequential write.
type headerBatch []headerEntry

Expand Down Expand Up @@ -134,7 +134,7 @@ func (h *headerIndex) addHeaders(batch headerBatch) error {
}

// In order to ensure optimal write performance, we'll ensure that the
// items are sorted before insertion into the database.
// items are sorted by their hash before insertion into the database.
sort.Sort(batch)

return walletdb.Update(h.db, func(tx walletdb.ReadWriteTx) error {
Expand Down

0 comments on commit 960dc9e

Please sign in to comment.