From eb03422c93022fecbe608f619bbc7fd14a98ab6b Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Mon, 8 Feb 2021 18:06:50 +0100 Subject: [PATCH] feat: add ends-in to pending publish deals output --- cmd/lotus-storage-miner/market.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-storage-miner/market.go b/cmd/lotus-storage-miner/market.go index 68fc0f761..f46ad32bf 100644 --- a/cmd/lotus-storage-miner/market.go +++ b/cmd/lotus-storage-miner/market.go @@ -859,8 +859,9 @@ var dealsPendingPublish = &cli.Command{ } if len(pending.Deals) > 0 { + endsIn := pending.PublishPeriodStart.Add(pending.PublishPeriod).Sub(time.Now()) w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - _, _ = fmt.Fprintf(w, "Publish period: %s\n", pending.PublishPeriod) + _, _ = fmt.Fprintf(w, "Publish period: %s (ends in %s)\n", pending.PublishPeriod, endsIn.Round(time.Second)) _, _ = fmt.Fprintf(w, "First deal queued at: %s\n", pending.PublishPeriodStart) _, _ = fmt.Fprintf(w, "Deals will be published at: %s\n", pending.PublishPeriodStart.Add(pending.PublishPeriod)) _, _ = fmt.Fprintf(w, "%d deals queued to be published:\n", len(pending.Deals))