forked from cerc-io/plugeth
Add contract addr if it's a contract creation tx
This commit is contained in:
parent
ab8c7252da
commit
cfb979b5e3
@ -70,6 +70,10 @@ type PTx struct {
|
|||||||
func NewPTx(tx *ethchain.Transaction) *PTx {
|
func NewPTx(tx *ethchain.Transaction) *PTx {
|
||||||
hash := hex.EncodeToString(tx.Hash())
|
hash := hex.EncodeToString(tx.Hash())
|
||||||
receiver := hex.EncodeToString(tx.Recipient)
|
receiver := hex.EncodeToString(tx.Recipient)
|
||||||
|
|
||||||
|
if receiver == "" {
|
||||||
|
receiver = hex.EncodeToString(tx.CreationAddress())
|
||||||
|
}
|
||||||
sender := hex.EncodeToString(tx.Sender())
|
sender := hex.EncodeToString(tx.Sender())
|
||||||
data := strings.Join(ethchain.Disassemble(tx.Data), "\n")
|
data := strings.Join(ethchain.Disassemble(tx.Data), "\n")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user