add mpool pending command
This commit is contained in:
@@ -18,6 +18,7 @@ type API struct {
|
||||
Host host.Host
|
||||
Chain *chain.ChainStore
|
||||
PubSub *pubsub.PubSub
|
||||
Mpool *chain.MessagePool
|
||||
}
|
||||
|
||||
func (a *API) ChainSubmitBlock(ctx context.Context, blk *chain.BlockMsg) error {
|
||||
@@ -44,6 +45,10 @@ func (a *API) Version(context.Context) (api.Version, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (a *API) MpoolPending(context.Context) ([]*chain.SignedMessage, error) {
|
||||
return a.Mpool.Pending(), nil
|
||||
}
|
||||
|
||||
func (a *API) NetPeers(context.Context) ([]peer.AddrInfo, error) {
|
||||
conns := a.Host.Network().Conns()
|
||||
out := make([]peer.AddrInfo, len(conns))
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ const (
|
||||
StartListeningKey
|
||||
|
||||
// filecoin
|
||||
SetGenisisKey
|
||||
SetGenesisKey
|
||||
|
||||
RunHelloKey
|
||||
RunBlockSyncKey
|
||||
@@ -171,7 +171,7 @@ func Online() Option {
|
||||
Override(new(*chain.MessagePool), chain.NewMessagePool),
|
||||
|
||||
Override(new(modules.Genesis), testing.MakeGenesis),
|
||||
Override(SetGenisisKey, modules.SetGenesis),
|
||||
Override(SetGenesisKey, modules.SetGenesis),
|
||||
|
||||
Override(new(*hello.Service), hello.NewHelloService),
|
||||
Override(new(*chain.BlockSyncService), chain.NewBlockSyncService),
|
||||
|
||||
Reference in New Issue
Block a user