arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
Merge pull request #371 from hermeznetwork/feature/fixpanic1

Fix panic caused by nil batchInfo.ServerProof
arnau 17317030+arnaucube@users.noreply.github.com
Thu, 17 Dec 2020 15:12:03 +0100
commit

8838bd62f9c5886032a0857a0392a09559a23496

parent

a3d0765644eabfaf99f68fe50e7e97b177c73248

1 files changed, 5 insertions(+), 3 deletions(-)

jump to
M coordinator/coordinator.go → coordinator/coordinator.go

@@ -698,9 +698,12 @@ if common.IsErrDone(err) {

continue } else if err != nil { log.Errorw("proversPool.Get", "err", err) + continue } - if err := p.sendServerProof(p.ctx, serverProof, batchInfo); err != nil { + batchInfo.ServerProof = serverProof + if err := p.sendServerProof(p.ctx, batchInfo); err != nil { log.Errorw("sendServerProof", "err", err) + batchInfo.ServerProof = nil p.proversPool.Add(serverProof) continue }

@@ -762,8 +765,7 @@ return txIDs

} // sendServerProof sends the circuit inputs to the proof server -func (p *Pipeline) sendServerProof(ctx context.Context, serverProof prover.Client, - batchInfo *BatchInfo) error { +func (p *Pipeline) sendServerProof(ctx context.Context, batchInfo *BatchInfo) error { p.cfg.debugBatchStore(batchInfo) // 7. Call the selected idle server proof with BatchBuilder output,