aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/responses.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-04-02 20:54:28 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-04-02 20:54:28 +0800
commit876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17 (patch)
treeb1dda4e58f0c2fed203a8f7f313e5cd72fbfcb01 /rpc/responses.go
parent172b34351aeb03d0318d241c0941c27608448cfb (diff)
downloadgo-tangerine-876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17.tar
go-tangerine-876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17.tar.gz
go-tangerine-876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17.tar.bz2
go-tangerine-876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17.tar.lz
go-tangerine-876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17.tar.xz
go-tangerine-876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17.tar.zst
go-tangerine-876ce0fb12d7c1eae2907dad9ea13d01e9b3ac17.zip
More nil checks
Diffstat (limited to 'rpc/responses.go')
-rw-r--r--rpc/responses.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/rpc/responses.go b/rpc/responses.go
index 3d1687cb6..079ee8765 100644
--- a/rpc/responses.go
+++ b/rpc/responses.go
@@ -125,8 +125,6 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
}
func NewBlockRes(block *types.Block, fullTx bool) *BlockRes {
- // TODO respect fullTx flag
-
if block == nil {
return nil
}
@@ -182,6 +180,10 @@ type TransactionRes struct {
}
func NewTransactionRes(tx *types.Transaction) *TransactionRes {
+ if tx == nil {
+ return nil
+ }
+
var v = new(TransactionRes)
v.Hash = newHexData(tx.Hash())
v.Nonce = newHexNum(tx.Nonce())