From eeda3d476647f894ca02cbdbf32b4cc5b5129602 Mon Sep 17 00:00:00 2001 From: istae <14264581+istae@users.noreply.github.com> Date: Mon, 27 May 2024 20:10:49 +0300 Subject: [PATCH] fix: save stamp issuer after failed uploads (#4684) --- pkg/api/api.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/api/api.go b/pkg/api/api.go index 0d97a2abf0b..478c253cebb 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -801,15 +801,11 @@ func (p *putterSessionWrapper) Put(ctx context.Context, chunk swarm.Chunk) error } func (p *putterSessionWrapper) Done(ref swarm.Address) error { - err := p.PutterSession.Done(ref) - if err != nil { - return err - } - return p.save() + return errors.Join(p.PutterSession.Done(ref), p.save()) } func (p *putterSessionWrapper) Cleanup() error { - return p.PutterSession.Cleanup() + return errors.Join(p.PutterSession.Cleanup(), p.save()) } func (s *Service) getStamper(batchID []byte) (postage.Stamper, func() error, error) {