repair references to defunct miner.SelectMessages
This commit is contained in:
parent
1511644541
commit
6f660f7915
@ -6,7 +6,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
"github.com/filecoin-project/lotus/miner"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
@ -35,18 +34,13 @@ var minerSelectMsgsCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
msgs, err := api.MpoolPending(ctx, head.Key())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
filtered, err := miner.SelectMessages(ctx, api.StateGetActor, head, msgs)
|
||||
msgs, err := api.MpoolSelect(ctx, head.Key())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var totalGas int64
|
||||
for i, f := range filtered {
|
||||
for i, f := range msgs {
|
||||
from := f.Message.From.String()
|
||||
if len(from) > 8 {
|
||||
from = "..." + from[len(from)-8:]
|
||||
@ -61,8 +55,7 @@ var minerSelectMsgsCmd = &cli.Command{
|
||||
totalGas += f.Message.GasLimit
|
||||
}
|
||||
|
||||
fmt.Println("mempool input messages: ", len(msgs))
|
||||
fmt.Println("filtered messages: ", len(filtered))
|
||||
fmt.Println("selected messages: ", len(msgs))
|
||||
fmt.Printf("total gas limit of selected messages: %d / %d (%0.2f%%)\n", totalGas, build.BlockGasLimit, 100*float64(totalGas)/float64(build.BlockGasLimit))
|
||||
return nil
|
||||
},
|
||||
|
@ -12,7 +12,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/gen"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
"github.com/filecoin-project/lotus/miner"
|
||||
"github.com/filecoin-project/specs-actors/actors/crypto"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@ -34,20 +33,11 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pending, err := api.MpoolPending(ctx, head.Key())
|
||||
msgs, err := api.MpoolSelect(ctx, head.Key())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msgs, err := miner.SelectMessages(ctx, api.StateGetActor, head, pending)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(msgs) > build.BlockMessageLimit {
|
||||
log.Error("SelectMessages returned too many messages: ", len(msgs))
|
||||
msgs = msgs[:build.BlockMessageLimit]
|
||||
}
|
||||
|
||||
addr, _ := address.NewIDAddress(1000)
|
||||
var ticket *types.Ticket
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user