diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-28 18:15:43 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-28 18:15:43 +0800 |
commit | cfb979b5e3274a14319bce14ee0481a4cfaa5f41 (patch) | |
tree | 29bc8853d9973ec99ab4503fcf82d19e765f3d72 /ethpub | |
parent | ab8c7252da7688b9791b6654db8523c158e845a7 (diff) | |
download | go-tangerine-cfb979b5e3274a14319bce14ee0481a4cfaa5f41.tar go-tangerine-cfb979b5e3274a14319bce14ee0481a4cfaa5f41.tar.gz go-tangerine-cfb979b5e3274a14319bce14ee0481a4cfaa5f41.tar.bz2 go-tangerine-cfb979b5e3274a14319bce14ee0481a4cfaa5f41.tar.lz go-tangerine-cfb979b5e3274a14319bce14ee0481a4cfaa5f41.tar.xz go-tangerine-cfb979b5e3274a14319bce14ee0481a4cfaa5f41.tar.zst go-tangerine-cfb979b5e3274a14319bce14ee0481a4cfaa5f41.zip |
Add contract addr if it's a contract creation tx
Diffstat (limited to 'ethpub')
-rw-r--r-- | ethpub/types.go | 4 |
1 files changed, 4 insertions, 0 deletions
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") |