diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-06 11:37:45 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-06 11:37:45 +0800 |
commit | ef9d825cfaa274a4063bf7dcbf19c033e29b90aa (patch) | |
tree | f7bf3e516ed238b5f70fafc07a77eb21ea616f60 /xeth/xeth.go | |
parent | 9f5e9eb38d7bf00ec24ce4ae09f910236f776641 (diff) | |
download | dexon-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar.gz dexon-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.tar.zst dexon-ef9d825cfaa274a4063bf7dcbf19c033e29b90aa.zip |
Refactor & cleanup
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r-- | xeth/xeth.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 8dd905b86..451d3ceea 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -86,21 +86,17 @@ func (self *XEth) BlockByHash(strHash string) *Block { return NewBlock(block) } -func (self *XEth) BlockByNumber(num int32) *Block { - if num == -1 { - return NewBlock(self.chainManager.CurrentBlock()) - } - - return NewBlock(self.chainManager.GetBlockByNumber(uint64(num))) +func (self *XEth) BlockByNumber(num uint64) *Block { + return NewBlock(self.chainManager.GetBlockByNumber(num)) } func (self *XEth) Block(v interface{}) *Block { if n, ok := v.(int32); ok { - return self.BlockByNumber(n) + return self.BlockByNumber(uint64(n)) } else if str, ok := v.(string); ok { return self.BlockByHash(str) } else if f, ok := v.(float64); ok { // Don't ask ... - return self.BlockByNumber(int32(f)) + return self.BlockByNumber(uint64(f)) } return nil |