aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild/ldflags.sh7
-rw-r--r--rpc/api/parsing.go6
2 files changed, 12 insertions, 1 deletions
diff --git a/build/ldflags.sh b/build/ldflags.sh
index 9e17ca498..3f055d416 100755
--- a/build/ldflags.sh
+++ b/build/ldflags.sh
@@ -7,7 +7,12 @@ if [ ! -f "build/env.sh" ]; then
exit 2
fi
+# Since Go 1.5, the separator char for link time assignments
+# is '=' and using ' ' prints a warning. However, Go < 1.5 does
+# not support using '='.
+sep=$(go version | awk '{ if ($3 >= "go1.5" || index($3, "devel")) print "="; else print " "; }' -)
+
# set gitCommit when running from a Git checkout.
if [ -f ".git/HEAD" ]; then
- echo "-ldflags '-X main.gitCommit $(git rev-parse HEAD)'"
+ echo "-ldflags '-X main.gitCommit$sep$(git rev-parse HEAD)'"
fi
diff --git a/rpc/api/parsing.go b/rpc/api/parsing.go
index 0698e8dbe..5858bc136 100644
--- a/rpc/api/parsing.go
+++ b/rpc/api/parsing.go
@@ -169,6 +169,7 @@ type BlockRes struct {
LogsBloom *hexdata `json:"logsBloom"`
TransactionRoot *hexdata `json:"transactionsRoot"`
StateRoot *hexdata `json:"stateRoot"`
+ ReceiptRoot *hexdata `json:"receiptRoot"`
Miner *hexdata `json:"miner"`
Difficulty *hexnum `json:"difficulty"`
TotalDifficulty *hexnum `json:"totalDifficulty"`
@@ -192,6 +193,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
LogsBloom *hexdata `json:"logsBloom"`
TransactionRoot *hexdata `json:"transactionsRoot"`
StateRoot *hexdata `json:"stateRoot"`
+ ReceiptRoot *hexdata `json:"receiptRoot"`
Miner *hexdata `json:"miner"`
Difficulty *hexnum `json:"difficulty"`
TotalDifficulty *hexnum `json:"totalDifficulty"`
@@ -212,6 +214,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext.LogsBloom = b.LogsBloom
ext.TransactionRoot = b.TransactionRoot
ext.StateRoot = b.StateRoot
+ ext.ReceiptRoot = b.ReceiptRoot
ext.Miner = b.Miner
ext.Difficulty = b.Difficulty
ext.TotalDifficulty = b.TotalDifficulty
@@ -236,6 +239,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
LogsBloom *hexdata `json:"logsBloom"`
TransactionRoot *hexdata `json:"transactionsRoot"`
StateRoot *hexdata `json:"stateRoot"`
+ ReceiptRoot *hexdata `json:"receiptRoot"`
Miner *hexdata `json:"miner"`
Difficulty *hexnum `json:"difficulty"`
TotalDifficulty *hexnum `json:"totalDifficulty"`
@@ -256,6 +260,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
ext.LogsBloom = b.LogsBloom
ext.TransactionRoot = b.TransactionRoot
ext.StateRoot = b.StateRoot
+ ext.ReceiptRoot = b.ReceiptRoot
ext.Miner = b.Miner
ext.Difficulty = b.Difficulty
ext.TotalDifficulty = b.TotalDifficulty
@@ -291,6 +296,7 @@ func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
res.LogsBloom = newHexData(block.Bloom())
res.TransactionRoot = newHexData(block.TxHash())
res.StateRoot = newHexData(block.Root())
+ res.ReceiptRoot = newHexData(block.ReceiptHash())
res.Miner = newHexData(block.Coinbase())
res.Difficulty = newHexNum(block.Difficulty())
res.TotalDifficulty = newHexNum(block.Td)