From cfb979b5e3274a14319bce14ee0481a4cfaa5f41 Mon Sep 17 00:00:00 2001 From: Maran Date: Wed, 28 May 2014 12:15:43 +0200 Subject: [PATCH] Add contract addr if it's a contract creation tx --- ethpub/types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ethpub/types.go b/ethpub/types.go index 348ae3f25..87d4ef112 100644 --- a/ethpub/types.go +++ b/ethpub/types.go @@ -70,6 +70,10 @@ type PTx struct { func NewPTx(tx *ethchain.Transaction) *PTx { hash := hex.EncodeToString(tx.Hash()) receiver := hex.EncodeToString(tx.Recipient) + + if receiver == "" { + receiver = hex.EncodeToString(tx.CreationAddress()) + } sender := hex.EncodeToString(tx.Sender()) data := strings.Join(ethchain.Disassemble(tx.Data), "\n")