aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-02 03:18:09 +0800
committerobscuren <geffobscura@gmail.com>2014-12-02 03:18:09 +0800
commit6dc46d3341dc5fa25bd005f9606de258874139be (patch)
tree39b5d7dad5a943de4e187f99c93da5aa7fc9f2b8 /ethutil
parenta3559c5e1b469890bb8d71e9992175febaae31c7 (diff)
downloaddexon-6dc46d3341dc5fa25bd005f9606de258874139be.tar
dexon-6dc46d3341dc5fa25bd005f9606de258874139be.tar.gz
dexon-6dc46d3341dc5fa25bd005f9606de258874139be.tar.bz2
dexon-6dc46d3341dc5fa25bd005f9606de258874139be.tar.lz
dexon-6dc46d3341dc5fa25bd005f9606de258874139be.tar.xz
dexon-6dc46d3341dc5fa25bd005f9606de258874139be.tar.zst
dexon-6dc46d3341dc5fa25bd005f9606de258874139be.zip
Changed the way transactions are being added to the transaction pool
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/big.go10
1 files changed, 10 insertions, 0 deletions
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**