From 6dc46d3341dc5fa25bd005f9606de258874139be Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 1 Dec 2014 20:18:09 +0100 Subject: Changed the way transactions are being added to the transaction pool --- ethutil/big.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ethutil') diff --git a/ethutil/big.go b/ethutil/big.go index 07d1386e1..d4f6361e9 100644 --- a/ethutil/big.go +++ b/ethutil/big.go @@ -62,6 +62,16 @@ func S256(x *big.Int) *big.Int { } } +func FirstBitSet(v *big.Int) *big.Int { + for i := 0; i < v.BitLen(); i++ { + if v.Bit(i) > 0 { + return big.NewInt(int64(i)) + } + } + + return big.NewInt(int64(v.BitLen())) +} + // Big to bytes // // Returns the bytes of a big integer with the size specified by **base** -- cgit From a052357872217d5e99e7ee1a7a4b524b53addcdd Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 1 Dec 2014 22:05:38 +0100 Subject: Fixed EXP gas --- ethutil/big.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ethutil') diff --git a/ethutil/big.go b/ethutil/big.go index d4f6361e9..2ff1c72d8 100644 --- a/ethutil/big.go +++ b/ethutil/big.go @@ -62,14 +62,14 @@ func S256(x *big.Int) *big.Int { } } -func FirstBitSet(v *big.Int) *big.Int { +func FirstBitSet(v *big.Int) int { for i := 0; i < v.BitLen(); i++ { if v.Bit(i) > 0 { - return big.NewInt(int64(i)) + return i } } - return big.NewInt(int64(v.BitLen())) + return v.BitLen() } // Big to bytes -- cgit