diff options
Diffstat (limited to 'whisper/whisperv2/envelope.go')
-rw-r--r-- | whisper/whisperv2/envelope.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/whisper/whisperv2/envelope.go b/whisper/whisperv2/envelope.go index 7110ab457..9f1c68204 100644 --- a/whisper/whisperv2/envelope.go +++ b/whisper/whisperv2/envelope.go @@ -23,9 +23,11 @@ import ( "crypto/ecdsa" "encoding/binary" "fmt" + "math/big" "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/rlp" @@ -66,7 +68,8 @@ func (self *Envelope) Seal(pow time.Duration) { for i := 0; i < 1024; i++ { binary.BigEndian.PutUint32(d[60:], nonce) - firstBit := common.FirstBitSet(common.BigD(crypto.Keccak256(d))) + d := new(big.Int).SetBytes(crypto.Keccak256(d)) + firstBit := math.FirstBitSet(d) if firstBit > bestBit { self.Nonce, bestBit = nonce, firstBit } |