Merge pull request #104 from filecoin-project/feat/chain-notifs
expose head change notifications through api
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user