From 0e88f32d6628010c42bc7f96355523cd5eb769b4 Mon Sep 17 00:00:00 2001 From: ZenGround0 Date: Tue, 13 Oct 2020 00:47:43 -0400 Subject: [PATCH] Fix bug and add flag --- cmd/lotus-shed/postfind.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/lotus-shed/postfind.go b/cmd/lotus-shed/postfind.go index fd309445d..ffdfb4946 100644 --- a/cmd/lotus-shed/postfind.go +++ b/cmd/lotus-shed/postfind.go @@ -29,6 +29,11 @@ var postFindCmd = &cli.Command{ Name: "withpower", Usage: "only print addrs of miners with more than zero power", }, + &cli.IntFlag{ + Name: "lookback", + Usage: "number of past epochs to search for post", + Value: 2880, //default 1 day + } }, Action: func(c *cli.Context) error { api, acloser, err := lcli.GetFullNodeAPI(c) @@ -100,13 +105,13 @@ var postFindCmd = &cli.Command{ postedMiners := make(map[address.Address]struct{}) for _, msg := range msgs { - _, hasPower := minersToCheck[msg.To] + _, shouldCheck := minersToCheck[msg.To] _, seenBefore := postedMiners[msg.To] - if hasPower && !seenBefore { + if shouldCheck && !seenBefore { if msg.Method == builtin.MethodsMiner.SubmitWindowedPoSt { fmt.Printf("%s\n", msg.To) - minersToCheck[msg.To] = struct{}{} + postedMiners[msg.To] = struct{}{} } } }