From 3b19aa7c03786609cb391fa300b119e883a53921 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 22 May 2018 07:56:56 -0500 Subject: [PATCH] sharding: fully functional start func in notary service Former-commit-id: 0755ae70512ad06ee0710f20136883ecacc8cf63 [formerly 7d558c0b4d2dd5302eaf2b8e9f8d51224ffc3858] Former-commit-id: 3c6b00e5d5e3547260e6e0c1122ef64be08a40c1 --- sharding/notary/service.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sharding/notary/service.go b/sharding/notary/service.go index 698ac9d8b..8aff19934 100644 --- a/sharding/notary/service.go +++ b/sharding/notary/service.go @@ -22,14 +22,16 @@ func NewNotary(ctx *cli.Context, node node.Node) (*Notary, error) { func (n *Notary) Start() error { log.Info("Starting notary service") - // if n.node.DepositFlagSet() { - // if err := joinNotaryPool(n.node); err != nil { - // return err - // } - // } + // TODO: handle this better through goroutines. Right now, these methods + // have their own nested channels and goroutines within them. We need + // to make this as flat as possible at the Notary layer. + if n.node.DepositFlagSet() { + if err := joinNotaryPool(n.node); err != nil { + return err + } + } - // return subscribeBlockHeaders(n.node) - return nil + return subscribeBlockHeaders(n.node) } // Stop the main loop for notarizing collations.