Merge pull request #687 from karalabe/develop
xeth: fix #640, panic converting nil recipient to hex.
This commit is contained in:
commit
20fd60902b
@ -238,13 +238,11 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
|
|||||||
inout = "recv"
|
inout = "recv"
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
ptx := xeth.NewTx(tx)
|
||||||
ptx = xeth.NewTx(tx)
|
ptx.Sender = from.Hex()
|
||||||
send = from.Hex()
|
if to := tx.To(); to != nil {
|
||||||
rec = tx.To().Hex()
|
ptx.Address = to.Hex()
|
||||||
)
|
}
|
||||||
ptx.Sender = send
|
|
||||||
ptx.Address = rec
|
|
||||||
|
|
||||||
if window == "post" {
|
if window == "post" {
|
||||||
//gui.getObjectByName("transactionView").Call("addTx", ptx, inout)
|
//gui.getObjectByName("transactionView").Call("addTx", ptx, inout)
|
||||||
|
@ -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
Block a user