aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-10 16:20:04 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-10 16:20:04 +0800
commitb2b1241dd74137b8c17aa70b2225f76297ca00cf (patch)
tree2a2de02522672f7fd713bc4c6012b6b751d9b339 /xeth
parent4de1e1609abb2e5be7e5cc5b8f206d305af8ce27 (diff)
downloaddexon-b2b1241dd74137b8c17aa70b2225f76297ca00cf.tar
dexon-b2b1241dd74137b8c17aa70b2225f76297ca00cf.tar.gz
dexon-b2b1241dd74137b8c17aa70b2225f76297ca00cf.tar.bz2
dexon-b2b1241dd74137b8c17aa70b2225f76297ca00cf.tar.lz
dexon-b2b1241dd74137b8c17aa70b2225f76297ca00cf.tar.xz
dexon-b2b1241dd74137b8c17aa70b2225f76297ca00cf.tar.zst
dexon-b2b1241dd74137b8c17aa70b2225f76297ca00cf.zip
cmd/mist: fix #640, panic converting nil recipient to hex.
Fetching the recipient address from a transaction was changed to return nil instead of a zero-address, but this code path was not updated, so whenever a contract was created, a nil panic occured.
Diffstat (limited to 'xeth')
-rw-r--r--xeth/types.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/xeth/types.go b/xeth/types.go
index 739092474..1be5e109c 100644
--- a/xeth/types.go
+++ b/xeth/types.go
@@ -140,8 +140,11 @@ type Transaction struct {
func NewTx(tx *types.Transaction) *Transaction {
hash := tx.Hash().Hex()
- receiver := tx.To().Hex()
- if len(receiver) == 0 {
+
+ var receiver string
+ if to := tx.To(); to != nil {
+ receiver = to.Hex()
+ } else {
receiver = core.AddressFromMessage(tx).Hex()
}
sender, _ := tx.From()