aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 16:24:07 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-26 16:24:07 +0800
commit7e1e264375fe4bebbf6bb40604d0060744ebae2a (patch)
tree6a69c4f3fc212d780a49fb4f912b1a92dadffcaf /xeth
parent98f970ba59def547b07397d2bc743db0b0d571f3 (diff)
downloaddexon-7e1e264375fe4bebbf6bb40604d0060744ebae2a.tar.gz
dexon-7e1e264375fe4bebbf6bb40604d0060744ebae2a.tar.zst
dexon-7e1e264375fe4bebbf6bb40604d0060744ebae2a.zip
Don't return empty block for "pending" #568
Diffstat (limited to 'xeth')
-rw-r--r--xeth/xeth.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 25fdb8c89..bf30fc2fc 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -144,12 +144,8 @@ func (self *XEth) Whisper() *Whisper { return self.whisper }
func (self *XEth) getBlockByHeight(height int64) *types.Block {
var num uint64
- // -1 means "latest"
- // -2 means "pending", which has no blocknum
- if height <= -2 {
- return &types.Block{}
- } else if height == -1 {
- num = self.CurrentBlock().NumberU64()
+ if height < 0 {
+ num = self.CurrentBlock().NumberU64() + uint64(-1*height)
} else {
num = uint64(height)
}