From dbe472edd6b2b346872414c05f0eea006881a0f5 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 4 Jun 2017 14:40:00 -0700 Subject: [PATCH] build: update neutrino glide.lock hash, API usage --- chain/neutrino.go | 12 ++++++------ glide.lock | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chain/neutrino.go b/chain/neutrino.go index a64b5ed..e0305bf 100644 --- a/chain/neutrino.go +++ b/chain/neutrino.go @@ -100,7 +100,7 @@ func (s *NeutrinoClient) GetBlock(hash *chainhash.Hash) (*wire.MsgBlock, error) // since we can't actually return a FutureGetBlockVerboseResult because the // underlying type is private to btcrpcclient. func (s *NeutrinoClient) GetBlockHeight(hash *chainhash.Hash) (int32, error) { - _, height, err := s.CS.GetBlockByHash(*hash) + _, height, err := s.CS.BlockHeaders.FetchHeader(hash) if err != nil { return 0, err } @@ -109,12 +109,12 @@ func (s *NeutrinoClient) GetBlockHeight(hash *chainhash.Hash) (int32, error) { // GetBestBlock replicates the RPC client's GetBestBlock command. func (s *NeutrinoClient) GetBestBlock() (*chainhash.Hash, int32, error) { - header, height, err := s.CS.LatestBlock() + chainTip, err := s.CS.BestSnapshot() if err != nil { return nil, 0, err } - hash := header.BlockHash() - return &hash, int32(height), nil + + return &chainTip.Hash, chainTip.Height, nil } // BlockStamp returns the latest block notified by the client, or an error @@ -159,7 +159,7 @@ func (s *NeutrinoClient) Rescan(startHash *chainhash.Hash, addrs []btcutil.Addre for _, op := range outPoints { watchOutPoints = append(watchOutPoints, *op) } - header, height, err := s.CS.LatestBlock() + header, height, err := s.CS.BlockHeaders.ChainTip() if err != nil { return fmt.Errorf("Can't get chain service's best block: %s", err) } @@ -267,7 +267,7 @@ func (s *NeutrinoClient) onFilteredBlockConnected(height int32, case <-s.rescanQuit: return } - bs, err := s.CS.SyncedTo() + bs, err := s.CS.BestSnapshot() if err != nil { log.Errorf("Can't get chain service's best block: %s", err) return diff --git a/glide.lock b/glide.lock index f84b9b2..2a55ac2 100644 --- a/glide.lock +++ b/glide.lock @@ -97,7 +97,7 @@ imports: - name: github.com/kkdai/bstream version: f391b8402d23024e7c0f624b31267a89998fca95 - name: github.com/lightninglabs/neutrino - version: 113c35bb7044bb5a12c1484a5c089f13267026ed + version: 84eb5bf51fb61e4133090cef6ce6f7e31703826d repo: git@github.com:lightninglabs/neutrino - name: golang.org/x/crypto version: 0fe963104e9d1877082f8fb38f816fcd97eb1d10