From 5ca18837e9b723b3f9133e623a75cc101cfa782b Mon Sep 17 00:00:00 2001 From: Thibault Chataigner Date: Tue, 29 Aug 2017 15:39:27 +0200 Subject: [PATCH] Make DB blocks list public. This enable computing the first timestamp in the DB only accessing public interfaces. Signed-off-by: Thibault Chataigner --- db.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/db.go b/db.go index 87b5ed253..23e4364f6 100644 --- a/db.go +++ b/db.go @@ -520,6 +520,13 @@ func validateBlockSequence(bs []DiskBlock) error { return nil } +func (db *DB) Blocks() []DiskBlock { + db.mtx.RLock() + defer db.mtx.RUnlock() + + return db.blocks +} + // Close the partition. func (db *DB) Close() error { close(db.stopc)