Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
90e5c7ff
Commit
90e5c7ff
authored
Nov 18, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pin: Added a Pinner#Set function to retrieve the set of pinned keys
parent
91fe0d95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
pin/pin.go
pin/pin.go
+6
-0
No files found.
pin/pin.go
View file @
90e5c7ff
...
...
@@ -33,6 +33,7 @@ type Pinner interface {
Unpin
(
util
.
Key
,
bool
)
error
Flush
()
error
GetManual
()
ManualPinner
Set
()
set
.
BlockSet
}
// ManualPinner is for manually editing the pin structure
...
...
@@ -207,6 +208,11 @@ func LoadPinner(d ds.Datastore, dserv mdag.DAGService) (Pinner, error) {
return
p
,
nil
}
// Set returns a blockset of directly pinned keys
func
(
p
*
pinner
)
Set
()
set
.
BlockSet
{
return
p
.
directPin
}
// Flush encodes and writes pinner keysets to the datastore
func
(
p
*
pinner
)
Flush
()
error
{
p
.
lock
.
RLock
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment