diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-25 22:57:49 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-25 22:57:49 +0800 |
commit | 9ed8dc7384deb932be624699d9f628d3d00ba31e (patch) | |
tree | c20bab9c5c2b9b13be5f261cb72847ffa97654a2 /ethpipe/js_types.go | |
parent | 2458697dad8ceac5fe93182e141c7f2eb7428417 (diff) | |
download | go-tangerine-9ed8dc7384deb932be624699d9f628d3d00ba31e.tar go-tangerine-9ed8dc7384deb932be624699d9f628d3d00ba31e.tar.gz go-tangerine-9ed8dc7384deb932be624699d9f628d3d00ba31e.tar.bz2 go-tangerine-9ed8dc7384deb932be624699d9f628d3d00ba31e.tar.lz go-tangerine-9ed8dc7384deb932be624699d9f628d3d00ba31e.tar.xz go-tangerine-9ed8dc7384deb932be624699d9f628d3d00ba31e.tar.zst go-tangerine-9ed8dc7384deb932be624699d9f628d3d00ba31e.zip |
Attempt to catch up from unknown block
Diffstat (limited to 'ethpipe/js_types.go')
-rw-r--r-- | ethpipe/js_types.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ethpipe/js_types.go b/ethpipe/js_types.go index ccd585cf0..7266a5be4 100644 --- a/ethpipe/js_types.go +++ b/ethpipe/js_types.go @@ -23,12 +23,13 @@ type JSBlock struct { Name string `json:"name"` GasLimit string `json:"gasLimit"` GasUsed string `json:"gasUsed"` + PrevHash string `json:"prevHash"` } // Creates a new QML Block from a chain block func NewJSBlock(block *ethchain.Block) *JSBlock { if block == nil { - return nil + return &JSBlock{} } var ptxs []JSTransaction @@ -38,7 +39,14 @@ func NewJSBlock(block *ethchain.Block) *JSBlock { list := ethutil.NewList(ptxs) - return &JSBlock{ref: block, Size: block.Size().String(), Number: int(block.Number.Uint64()), GasUsed: block.GasUsed.String(), GasLimit: block.GasLimit.String(), Hash: ethutil.Bytes2Hex(block.Hash()), Transactions: list, Time: block.Time, Coinbase: ethutil.Bytes2Hex(block.Coinbase)} + return &JSBlock{ + ref: block, Size: block.Size().String(), + Number: int(block.Number.Uint64()), GasUsed: block.GasUsed.String(), + GasLimit: block.GasLimit.String(), Hash: ethutil.Bytes2Hex(block.Hash()), + Transactions: list, Time: block.Time, + Coinbase: ethutil.Bytes2Hex(block.Coinbase), + PrevHash: ethutil.Bytes2Hex(block.PrevHash), + } } func (self *JSBlock) ToString() string { |