Merge pull request #104 from filecoin-project/feat/chain-notifs

expose head change notifications through api
This commit is contained in:
Whyrusleeping
2019-07-29 11:36:04 -07:00
committed by GitHub
5 changed files with 24 additions and 5 deletions
+4
View File
@@ -33,6 +33,10 @@ type FullNodeAPI struct {
Wallet *wallet.Wallet
}
func (a *FullNodeAPI) ChainNotify(ctx context.Context) (<-chan *store.HeadChange, error) {
return a.Chain.SubHeadChanges(ctx), nil
}
func (a *FullNodeAPI) ChainSubmitBlock(ctx context.Context, blk *chain.BlockMsg) error {
if err := a.Chain.AddBlock(blk.Header); err != nil {
return err