add mpool pending command

This commit is contained in:
whyrusleeping
2019-07-10 12:20:16 -07:00
parent 999b7d568c
commit e09a379c3b
6 changed files with 51 additions and 3 deletions
+5
View File
@@ -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
View File
@@ -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),