add routine to tag miners peer IDs as high value in connection manager
This commit is contained in:
+5
-2
@@ -2,6 +2,7 @@ package impl
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gbrlsnchs/jwt/v3"
|
||||
"github.com/libp2p/go-libp2p-core/host"
|
||||
"github.com/libp2p/go-libp2p-core/network"
|
||||
@@ -13,13 +14,15 @@ import (
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/filecoin-project/lotus/node/peers"
|
||||
)
|
||||
|
||||
type CommonAPI struct {
|
||||
fx.In
|
||||
|
||||
APISecret *dtypes.APIAlg
|
||||
Host host.Host
|
||||
APISecret *dtypes.APIAlg
|
||||
Host host.Host
|
||||
PeerTagger *peers.PeerTagger // TODO: this needs a better home
|
||||
}
|
||||
|
||||
type jwtPayload struct {
|
||||
|
||||
+1
-12
@@ -223,18 +223,7 @@ func (a *StateAPI) StateGetReceipt(ctx context.Context, msg cid.Cid, ts *types.T
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateListMiners(ctx context.Context, ts *types.TipSet) ([]address.Address, error) {
|
||||
var state actors.StoragePowerState
|
||||
if _, err := a.StateManager.LoadActorState(ctx, actors.StoragePowerAddress, &state, ts); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cst := hamt.CSTFromBstore(a.StateManager.ChainStore().Blockstore())
|
||||
miners, err := actors.MinerSetList(ctx, cst, state.Miners)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return miners, nil
|
||||
return stmgr.ListMinerActors(ctx, a.StateManager, ts)
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateListActors(ctx context.Context, ts *types.TipSet) ([]address.Address, error) {
|
||||
|
||||
Reference in New Issue
Block a user