From bf3466f3cb87c4b96dd1c7cf140a745bf55d7e3b Mon Sep 17 00:00:00 2001 From: Travis Person Date: Sat, 5 Sep 2020 02:34:08 +0000 Subject: [PATCH] lotus-pcr: use current tipset during refund Using the tipset which is being processed might lead to incorrect gas estimations or balance checking for the wallet. --- cmd/lotus-pcr/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-pcr/main.go b/cmd/lotus-pcr/main.go index 613e746dc16..a5242bf2848 100644 --- a/cmd/lotus-pcr/main.go +++ b/cmd/lotus-pcr/main.go @@ -225,7 +225,12 @@ var runCmd = &cli.Command{ continue } - if err := rf.Refund(ctx, tipset, refunds, rounds); err != nil { + refundTipset, err := api.ChainHead(ctx) + if err != nil { + return err + } + + if err := rf.Refund(ctx, refundTipset, refunds, rounds); err != nil { return err }