~whereswaldon/sprout-go

d98b57817b6db1557f764d686ca95f58c80164b1 — Chris Waldon 6 months ago f66714d
bugfix: worker: ensure local leaves are sent

This fix changes which slice is iterated to fetch all leaf nodes
from a Store(). Previously I used the destination slice which actually
has len 0. This caused the for loop to always be skipped.
1 files changed, 1 insertions(+), 1 deletions(-)

M worker.go
M worker.go => worker.go +1 -1
@@ 391,7 391,7 @@ func (c *Worker) synchronizeFullTree(root forest.Node, maxNodes int, perRequestT
		return fmt.Errorf("couldn't list local leaves of node %s: %w", root.ID(), err)
	}
	localLeafNodes := make([]forest.Node, 0, len(localLeaves))
	for i := range localLeafNodes {
	for i := range localLeaves {
		node, inStore, err := archive.Get(localLeaves[i])
		if err != nil {
			return fmt.Errorf("couldn't get local node %s: %w", localLeaves[i], err)