From ffb069efa9d7045a560b7f1021301fc3cba3b458 Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Tue, 19 Jul 2022 15:13:41 -0600 Subject: [PATCH] add storage proof requeue --- modules/host/storageobligations.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/host/storageobligations.go b/modules/host/storageobligations.go index 6c8ed5408..ba73a63f9 100644 --- a/modules/host/storageobligations.go +++ b/modules/host/storageobligations.go @@ -1316,6 +1316,20 @@ func (h *Host) threadedHandleActionItem(soid types.FileContractID) { return } + // Queue another action item to check the status of the storage proof. + // Additional action items should not be queued on or after the proof + // deadline to prevent removeStorageObligation from being called + // multiple times. + recheckHeight := blockHeight + resubmissionTimeout + if so.proofDeadline() > recheckHeight { + h.mu.Lock() + err := h.queueActionItem(recheckHeight, so.id()) + h.mu.Unlock() + if err != nil { + h.log.Printf("contract %s action: Error queuing action item: %s", soid, err) + } + } + // Get the index of the segment for which to build the proof. segmentIndex, err := h.cs.StorageProofSegment(so.id()) if err != nil {