diff --git a/node/crypto/lazy_proof_tree.go b/node/crypto/lazy_proof_tree.go index 390f80f..0d76074 100644 --- a/node/crypto/lazy_proof_tree.go +++ b/node/crypto/lazy_proof_tree.go @@ -103,7 +103,11 @@ func (n *LazyVectorCommitmentBranchNode) Commit( if n.Commitment == nil || recalculate { vector := make([][]byte, len(n.Children)) wg := sync.WaitGroup{} - throttle := make(chan struct{}, runtime.WorkerCount(0, false)) + workers := 1 + if n.LongestBranch == 2 { + workers = runtime.WorkerCount(0, false) + } + throttle := make(chan struct{}, workers) for i, child := range n.Children { throttle <- struct{}{} wg.Add(1) diff --git a/node/rpc/hypergraph_sync_rpc_server_test.go b/node/rpc/hypergraph_sync_rpc_server_test.go index 1c37418..5d79a6d 100644 --- a/node/rpc/hypergraph_sync_rpc_server_test.go +++ b/node/rpc/hypergraph_sync_rpc_server_test.go @@ -67,6 +67,7 @@ func TestLoadHypergraphFallback(t *testing.T) { } for k, a := range clientLoad.GetVertexAdds() { assert.Equal(t, len(crypto.ConvertAllPreloadedLeaves(string(application.VertexAtomType), string(application.AddsPhaseType), k, clientHypergraphStore, a.GetTree().Root, []int{})), 100000) + fmt.Printf("%x\n", a.GetTree().Commit(true)) } fmt.Println("Should not reattempt") @@ -75,6 +76,7 @@ func TestLoadHypergraphFallback(t *testing.T) { assert.NoError(t, err) clientLoad, err = clientHypergraphStore.LoadHypergraph() assert.NoError(t, err) + t.FailNow() } func TestHypergraphSyncServer(t *testing.T) {