From be3865211c2d8f71e0733b17c469881502e89371 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 9 Nov 2016 01:20:49 +0100 Subject: core/types: remove header accessors These accessors were introduced by light client changes, but the only method that is actually used is GetNumberU64. This commit replaces all uses of .GetNumberU64 with .Number.Uint64. --- eth/filters/filter_system.go | 4 ++-- eth/gasprice/lightprice.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'eth') diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 1e330b24f..c2c072a9f 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -309,11 +309,11 @@ func (es *EventSystem) lightFilterNewHead(newHeader *types.Header, callBack func // find common ancestor, create list of rolled back and new block hashes var oldHeaders, newHeaders []*types.Header for oldh.Hash() != newh.Hash() { - if oldh.GetNumberU64() >= newh.GetNumberU64() { + if oldh.Number.Uint64() >= newh.Number.Uint64() { oldHeaders = append(oldHeaders, oldh) oldh = core.GetHeader(es.backend.ChainDb(), oldh.ParentHash, oldh.Number.Uint64()-1) } - if oldh.GetNumberU64() < newh.GetNumberU64() { + if oldh.Number.Uint64() < newh.Number.Uint64() { newHeaders = append(newHeaders, newh) newh = core.GetHeader(es.backend.ChainDb(), newh.ParentHash, newh.Number.Uint64()-1) if newh == nil { diff --git a/eth/gasprice/lightprice.go b/eth/gasprice/lightprice.go index ce075ff4e..f6d290bb7 100644 --- a/eth/gasprice/lightprice.go +++ b/eth/gasprice/lightprice.go @@ -78,7 +78,7 @@ func (self *LightPriceOracle) SuggestPrice(ctx context.Context) (*big.Int, error return lastPrice, nil } - blockNum := head.GetNumberU64() + blockNum := head.Number.Uint64() chn := make(chan lpResult, LpoMaxBlocks) sent := 0 exp := 0 -- cgit