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.
pull/687/head
Péter Szilágyi 10 years ago
parent 4de1e1609a
commit b2b1241dd7
  1. 7
      xeth/types.go

@ -140,8 +140,11 @@ type Transaction struct {
func NewTx(tx *types.Transaction) *Transaction { func NewTx(tx *types.Transaction) *Transaction {
hash := tx.Hash().Hex() 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() receiver = core.AddressFromMessage(tx).Hex()
} }
sender, _ := tx.From() sender, _ := tx.From()

Loading…
Cancel
Save