From 4808b49090074be9e6397b12ac582a7088973306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 20 Feb 2024 14:14:26 +0100 Subject: [PATCH] lpmarket: Fix result output in case of tx retry --- provider/lpseal/sector_num_alloc.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/provider/lpseal/sector_num_alloc.go b/provider/lpseal/sector_num_alloc.go index 1f6a760d1..15f6b3435 100644 --- a/provider/lpseal/sector_num_alloc.go +++ b/provider/lpseal/sector_num_alloc.go @@ -32,6 +32,8 @@ func AllocateSectorNumbers(ctx context.Context, a AllocAPI, db *harmonydb.DB, ma var res []abi.SectorNumber comm, err := db.BeginTransaction(ctx, func(tx *harmonydb.Tx) (commit bool, err error) { + res = nil // reset result in case of retry + // query from db, if exists unmarsal to bitfield var dbAllocated bitfield.BitField var rawJson []byte