expose head change notifications through api

This commit is contained in:
whyrusleeping
2019-07-28 12:19:33 -07:00
parent f712f56c6d
commit 03f653b88e
5 changed files with 24 additions and 5 deletions
+4
View File
@@ -31,6 +31,10 @@ type FullNodeAPI struct {
Wallet *chain.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