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.
This commit is contained in:
Péter Szilágyi 2015-04-10 11:20:04 +03:00
parent 4de1e1609a
commit b2b1241dd7

View File

@ -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()