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:
parent
4de1e1609a
commit
b2b1241dd7
|
@ -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…
Reference in New Issue