diff options
author | Vitalik Buterin <v@buterin.com> | 2015-07-02 17:27:31 +0800 |
---|---|---|
committer | Vitalik Buterin <v@buterin.com> | 2015-07-02 17:27:31 +0800 |
commit | 9f6016e8773f951c5b81b30c0257350e2a9c8e5f (patch) | |
tree | 5ffec7e645dda2d79af1b011c2e03b213bef2435 /xeth | |
parent | 744af9f497d25b55246695dec831eb9345401984 (diff) | |
parent | 75f41dedcab63e23ab9c58dcda3da02e3dbb29cb (diff) | |
download | go-tangerine-9f6016e8773f951c5b81b30c0257350e2a9c8e5f.tar go-tangerine-9f6016e8773f951c5b81b30c0257350e2a9c8e5f.tar.gz go-tangerine-9f6016e8773f951c5b81b30c0257350e2a9c8e5f.tar.bz2 go-tangerine-9f6016e8773f951c5b81b30c0257350e2a9c8e5f.tar.lz go-tangerine-9f6016e8773f951c5b81b30c0257350e2a9c8e5f.tar.xz go-tangerine-9f6016e8773f951c5b81b30c0257350e2a9c8e5f.tar.zst go-tangerine-9f6016e8773f951c5b81b30c0257350e2a9c8e5f.zip |
Merge branch 'develop' of github.com:ethereum/go-ethereum into develop
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/types.go | 3 | ||||
-rw-r--r-- | xeth/xeth.go | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/xeth/types.go b/xeth/types.go index 1d6a0c5ca..cc06a8dcd 100644 --- a/xeth/types.go +++ b/xeth/types.go @@ -149,7 +149,8 @@ func NewTx(tx *types.Transaction) *Transaction { if to := tx.To(); to != nil { receiver = to.Hex() } else { - receiver = core.AddressFromMessage(tx).Hex() + from, _ := tx.From() + receiver = crypto.CreateAddress(from, tx.Nonce()).Hex() } createsContract := core.MessageCreatesContract(tx) diff --git a/xeth/xeth.go b/xeth/xeth.go index 0dbedff43..2a1366fe1 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -802,7 +802,12 @@ func (self *XEth) PushTx(encodedTx string) (string, error) { } if tx.To() == nil { - addr := core.AddressFromMessage(tx) + from, err := tx.From() + if err != nil { + return "", err + } + + addr := crypto.CreateAddress(from, tx.Nonce()) glog.V(logger.Info).Infof("Tx(%x) created: %x\n", tx.Hash(), addr) return addr.Hex(), nil } else { @@ -969,7 +974,7 @@ func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceS } if contractCreation { - addr := core.AddressFromMessage(tx) + addr := crypto.CreateAddress(from, nonce) glog.V(logger.Info).Infof("Tx(%x) created: %x\n", tx.Hash(), addr) return addr.Hex(), nil } else { |