Commit ac563d76 authored by Jeromy's avatar Jeromy Committed by Juan Batiz-Benet

blockstore.ErrNotFound, and proper wantlist sorting

parent 70c89ffb
...@@ -68,7 +68,7 @@ func (s *strategist) getSendableBlocks(wantlist *wl.Wantlist, bs bstore.Blocksto ...@@ -68,7 +68,7 @@ func (s *strategist) getSendableBlocks(wantlist *wl.Wantlist, bs bstore.Blocksto
var outblocks []*blocks.Block var outblocks []*blocks.Block
for _, e := range wantlist.Entries() { for _, e := range wantlist.Entries() {
block, err := bs.Get(e.Value) block, err := bs.Get(e.Value)
if err == u.ErrNotFound { if err == bstore.ErrNotFound {
continue continue
} }
if err != nil { if err != nil {
......
...@@ -43,7 +43,7 @@ type entrySlice []*Entry ...@@ -43,7 +43,7 @@ type entrySlice []*Entry
func (es entrySlice) Len() int { return len(es) } func (es entrySlice) Len() int { return len(es) }
func (es entrySlice) Swap(i, j int) { es[i], es[j] = es[j], es[i] } func (es entrySlice) Swap(i, j int) { es[i], es[j] = es[j], es[i] }
func (es entrySlice) Less(i, j int) bool { return es[i].Priority < es[j].Priority } func (es entrySlice) Less(i, j int) bool { return es[i].Priority > es[j].Priority }
func (w *Wantlist) Entries() []*Entry { func (w *Wantlist) Entries() []*Entry {
var es entrySlice var es entrySlice
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment