We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 657a9ed commit 551c966Copy full SHA for 551c966
blocks/blockstore/blockstore.go
@@ -49,6 +49,8 @@ type Blockstore interface {
49
// HashOnRead specifies if every read block should be
50
// rehashed to make sure it matches its CID.
51
HashOnRead(enabled bool)
52
+ // RegisterEventHandler registers an event handler
53
+ RegisterEventHandler(EventID, EventFunc)
54
}
55
56
// GCLocker abstract functionality to lock a blockstore when performing
@@ -107,6 +109,10 @@ type blockstore struct {
107
109
rehash bool
108
110
111
112
+func (bs *blockstore) RegisterEventHandler(t EventID, eh EventFunc) {
113
+ bs.events.addHandler(t, eh)
114
+}
115
+
116
func (bs *blockstore) HashOnRead(enabled bool) {
117
bs.rehash = enabled
118
0 commit comments