Commit 30cc892d authored by Steven Allen's avatar Steven Allen

bitswap: actually *update* wantlist entries in outbound wantlist messages

Before, we weren't using a pointer so we were throwing away the update.

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent af6e6f0b
......@@ -50,7 +50,7 @@ type Exportable interface {
type impl struct {
full bool
wantlist map[string]Entry
wantlist map[string]*Entry
blocks map[string]blocks.Block
}
......@@ -61,7 +61,7 @@ func New(full bool) BitSwapMessage {
func newMsg(full bool) *impl {
return &impl{
blocks: make(map[string]blocks.Block),
wantlist: make(map[string]Entry),
wantlist: make(map[string]*Entry),
full: full,
}
}
......@@ -122,7 +122,7 @@ func (m *impl) Empty() bool {
func (m *impl) Wantlist() []Entry {
out := make([]Entry, 0, len(m.wantlist))
for _, e := range m.wantlist {
out = append(out, e)
out = append(out, *e)
}
return out
}
......@@ -151,7 +151,7 @@ func (m *impl) addEntry(c *cid.Cid, priority int, cancel bool) {
e.Priority = priority
e.Cancel = cancel
} else {
m.wantlist[k] = Entry{
m.wantlist[k] = &Entry{
Entry: &wantlist.Entry{
Cid: c,
Priority: priority,
......
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