From d1e49493b02c35db311e2d841ce03a31f1abd4c6 Mon Sep 17 00:00:00 2001 From: mdr0id Date: Mon, 10 Jun 2019 20:35:32 -0700 Subject: [PATCH] Remove/add white space nits. Add comment for -8 value check in error conditional --- cmd/ingest/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/ingest/main.go b/cmd/ingest/main.go index 5358417..0b20ef8 100644 --- a/cmd/ingest/main.go +++ b/cmd/ingest/main.go @@ -101,7 +101,7 @@ func main() { }).Warn("zcash.conf failed, will try empty credentials for rpc") //Default to testnet, but user MUST specify rpcuser and rpcpassword in zcash.conf; no default - rpcClient, err = frontend.NewZRPCFromCreds("127.0.0.1:18232", " ", " ") + rpcClient, err = frontend.NewZRPCFromCreds("127.0.0.1:18232", "", "") if err != nil { log.WithFields(logrus.Fields{ @@ -136,11 +136,11 @@ func main() { "error": err, }).Fatal("error with getblock") } - if block != nil{ - handleBlock(db , block) + if block != nil { + handleBlock(db, block) height++ //TODO store block current/prev hash for formal reorg - }else{ + } else { //TODO implement blocknotify to minimize polling on corner cases time.Sleep(60 * time.Second) } @@ -160,6 +160,7 @@ func getBlock(rpcClient *rpcclient.Client, height int) (*parser.Block, error) { if rpcErr != nil { errParts := strings.SplitN(rpcErr.Error(), ":", 2) errCode, err = strconv.ParseInt(errParts[0], 10, 32) + //Check to see if we are requesting a height the zcashd doesn't have yet if err == nil && errCode == -8 { return nil, nil }