diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-27 22:50:44 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-27 22:53:35 +0800 |
commit | 16e52327a4baa5547c38965fce53b3ff40b98173 (patch) | |
tree | 27fb43512c802e2c3c0fe8bd8d97a55aa2499758 /ethutil | |
parent | 05d2d8f27d0bea5b20be9bc3b4a259a12298ecab (diff) | |
download | go-tangerine-16e52327a4baa5547c38965fce53b3ff40b98173.tar go-tangerine-16e52327a4baa5547c38965fce53b3ff40b98173.tar.gz go-tangerine-16e52327a4baa5547c38965fce53b3ff40b98173.tar.bz2 go-tangerine-16e52327a4baa5547c38965fce53b3ff40b98173.tar.lz go-tangerine-16e52327a4baa5547c38965fce53b3ff40b98173.tar.xz go-tangerine-16e52327a4baa5547c38965fce53b3ff40b98173.tar.zst go-tangerine-16e52327a4baa5547c38965fce53b3ff40b98173.zip |
Upped version number
Diffstat (limited to 'ethutil')
-rw-r--r-- | ethutil/big.go | 8 | ||||
-rw-r--r-- | ethutil/common.go | 7 | ||||
-rw-r--r-- | ethutil/config.go | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/ethutil/big.go b/ethutil/big.go index 1a3902fa3..c0488a71f 100644 --- a/ethutil/big.go +++ b/ethutil/big.go @@ -50,3 +50,11 @@ func BigCopy(src *big.Int) (ret *big.Int) { return } + +func BigMax(x, y *big.Int) *big.Int { + if x.Cmp(y) <= 0 { + return x + } + + return y +} diff --git a/ethutil/common.go b/ethutil/common.go index c63af29a6..d0ee7b538 100644 --- a/ethutil/common.go +++ b/ethutil/common.go @@ -38,5 +38,12 @@ var ( Big1 = big.NewInt(1) Big2 = big.NewInt(1) Big0 = big.NewInt(0) + Big32 = big.NewInt(32) Big256 = big.NewInt(0xff) ) + +func CreateAddress(b []byte, nonce *big.Int) []byte { + addrBytes := append(b, nonce.Bytes()...) + + return Sha3Bin(addrBytes)[12:] +} diff --git a/ethutil/config.go b/ethutil/config.go index 54b066fb9..86c0a855d 100644 --- a/ethutil/config.go +++ b/ethutil/config.go @@ -48,7 +48,7 @@ func ReadConfig(base string) *config { } } - Config = &config{ExecPath: path, Debug: true, Ver: "0.3.1"} + Config = &config{ExecPath: path, Debug: true, Ver: "0.5"} Config.Log = NewLogger(LogFile|LogStd, LogLevelDebug) Config.SetClientString("/Ethereum(G)") } |