aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd/mist/gui.go12
-rw-r--r--xeth/types.go7
2 files changed, 10 insertions, 9 deletions
diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go
index d37d6f81b..66614478c 100644
--- a/cmd/mist/gui.go
+++ b/cmd/mist/gui.go
@@ -238,13 +238,11 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
inout = "recv"
}
- var (
- ptx = xeth.NewTx(tx)
- send = from.Hex()
- rec = tx.To().Hex()
- )
- ptx.Sender = send
- ptx.Address = rec
+ ptx := xeth.NewTx(tx)
+ ptx.Sender = from.Hex()
+ if to := tx.To(); to != nil {
+ ptx.Address = to.Hex()
+ }
if window == "post" {
//gui.getObjectByName("transactionView").Call("addTx", ptx, inout)
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()