pin: Added a Pinner#Set function to retrieve the set of pinned keys
Matt Bell committed
Nov 18, 2014 at 23:02 UTC
90e5c7ffa8b7f636cf1bbecaf5c800b2b4331421
1 file changed
+6
pin/pin.go
+6
@@ -33,6 +33,7 @@ type Pinner interface {
33
Unpin(util.Key, bool) error
34
Flush() error
35
GetManual() ManualPinner
36
+ Set() set.BlockSet
37
}
38
39
// ManualPinner is for manually editing the pin structure
@@ -207,6 +208,11 @@ func LoadPinner(d ds.Datastore, dserv mdag.DAGService) (Pinner, error) {
208
return p, nil
209
}
210
211
+// Set returns a blockset of directly pinned keys
212
+func (p *pinner) Set() set.BlockSet {
213
+ return p.directPin
214
+}
215
+
216
// Flush encodes and writes pinner keysets to the datastore
217
func (p *pinner) Flush() error {
218
p.lock.RLock()