mirror of https://github.com/status-im/op-geth.git
Merge remote-tracking branch 'upstream/develop' into frontier/nodeadmin.js
This commit is contained in:
commit
8139d444f8
|
@ -22,8 +22,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/ethereum/ethash",
|
"ImportPath": "github.com/ethereum/ethash",
|
||||||
"Comment": "v23-11-g5376ec8",
|
"Comment": "v23-12-g149261a",
|
||||||
"Rev": "5376ec8816d6bf787d4fc91a08b4527bc5e1f469"
|
"Rev": "149261a5d7cafc3943cbcf1d370082ec70d81e8b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/ethereum/serpent-go",
|
"ImportPath": "github.com/ethereum/serpent-go",
|
||||||
|
|
|
@ -102,7 +102,9 @@ func makeParamsAndCache(chainManager pow.ChainManager, blockNum uint64) (*Params
|
||||||
|
|
||||||
func (pow *Ethash) UpdateCache(force bool) error {
|
func (pow *Ethash) UpdateCache(force bool) error {
|
||||||
pow.cacheMutex.Lock()
|
pow.cacheMutex.Lock()
|
||||||
thisEpoch := pow.chainManager.CurrentBlock().NumberU64()
|
defer pow.cacheMutex.Unlock()
|
||||||
|
|
||||||
|
thisEpoch := pow.chainManager.CurrentBlock().NumberU64() / epochLength
|
||||||
if force || pow.paramsAndCache.Epoch != thisEpoch {
|
if force || pow.paramsAndCache.Epoch != thisEpoch {
|
||||||
var err error
|
var err error
|
||||||
pow.paramsAndCache, err = makeParamsAndCache(pow.chainManager, pow.chainManager.CurrentBlock().NumberU64())
|
pow.paramsAndCache, err = makeParamsAndCache(pow.chainManager, pow.chainManager.CurrentBlock().NumberU64())
|
||||||
|
@ -110,7 +112,7 @@ func (pow *Ethash) UpdateCache(force bool) error {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pow.cacheMutex.Unlock()
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,10 +47,12 @@ If you intend to develop on go-ethereum, check the [Developers' Guide](https://g
|
||||||
Automated (dev) builds
|
Automated (dev) builds
|
||||||
======================
|
======================
|
||||||
|
|
||||||
* [[Docker](https://registry.hub.docker.com/u/ethereum/client-go/)]
|
* [Docker](https://registry.hub.docker.com/u/ethereum/client-go/)
|
||||||
* [[OS X](http://build.ethdev.com/builds/OSX%20Go%20develop%20branch/Mist-OSX-latest.dmg)]
|
* [OS X](http://build.ethdev.com/builds/OSX%20Go%20develop%20branch/Mist-OSX-latest.dmg)
|
||||||
|
* Ubuntu
|
||||||
|
[trusty](https://build.ethdev.com/builds/Linux%20Go%20develop%20deb%20i386-trusty/latest/ethereum-cli_0.9.0%2B192SNAPSHOT20150314224122trusty-0ubuntu1_i386.deb) |
|
||||||
|
[utopic](https://build.ethdev.com/builds/Linux%20Go%20develop%20deb%20i386-utopic/latest/ethereum-cli_0.9.0%2B194SNAPSHOT20150314224124utopic-0ubuntu1_i386.deb)
|
||||||
* [Windows] Coming soon™
|
* [Windows] Coming soon™
|
||||||
* [Linux] Coming soon™
|
|
||||||
|
|
||||||
Executables
|
Executables
|
||||||
===========
|
===========
|
||||||
|
|
|
@ -199,7 +199,7 @@ func (self *BlockPool) Start() {
|
||||||
case <-self.quit:
|
case <-self.quit:
|
||||||
return
|
return
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
plog.Debugf("status:\n%v", self.Status())
|
plog.DebugDetailf("status:\n%v", self.Status())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
package ethutil
|
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/rand"
|
|
||||||
"encoding/binary"
|
|
||||||
"io"
|
|
||||||
)
|
|
||||||
|
|
||||||
func randomUint64(r io.Reader) (uint64, error) {
|
|
||||||
b := make([]byte, 8)
|
|
||||||
n, err := r.Read(b)
|
|
||||||
if n != len(b) {
|
|
||||||
return 0, io.ErrShortBuffer
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
return binary.BigEndian.Uint64(b), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// RandomUint64 returns a cryptographically random uint64 value.
|
|
||||||
func RandomUint64() (uint64, error) {
|
|
||||||
return randomUint64(rand.Reader)
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package ethutil
|
|
||||||
|
|
||||||
import (
|
|
||||||
checker "gopkg.in/check.v1"
|
|
||||||
)
|
|
||||||
|
|
||||||
type RandomSuite struct{}
|
|
||||||
|
|
||||||
var _ = checker.Suite(&RandomSuite{})
|
|
||||||
|
|
||||||
func (s *RandomSuite) TestRandomUint64(c *checker.C) {
|
|
||||||
res1, _ := RandomUint64()
|
|
||||||
res2, _ := RandomUint64()
|
|
||||||
c.Assert(res1, checker.NotNil)
|
|
||||||
c.Assert(res2, checker.NotNil)
|
|
||||||
c.Assert(res1, checker.Not(checker.Equals), res2)
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
// +build !windows
|
|
||||||
|
|
||||||
package ethutil
|
|
||||||
|
|
||||||
import "github.com/ethereum/serpent-go"
|
|
||||||
|
|
||||||
// General compile function
|
|
||||||
func Compile(script string, silent bool) (ret []byte, err error) {
|
|
||||||
if len(script) > 2 {
|
|
||||||
byteCode, err := serpent.Compile(script)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return byteCode, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
// +build windows
|
|
||||||
|
|
||||||
package ethutil
|
|
||||||
|
|
||||||
// General compile function
|
|
||||||
func Compile(script string, silent bool) (ret []byte, err error) {
|
|
||||||
if len(script) > 2 {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
package ethutil
|
|
||||||
|
|
||||||
type Settable interface {
|
|
||||||
AsSet() UniqueSet
|
|
||||||
}
|
|
||||||
|
|
||||||
type Stringable interface {
|
|
||||||
String() string
|
|
||||||
}
|
|
||||||
|
|
||||||
type UniqueSet map[string]struct{}
|
|
||||||
|
|
||||||
func NewSet(v ...Stringable) UniqueSet {
|
|
||||||
set := make(UniqueSet)
|
|
||||||
for _, val := range v {
|
|
||||||
set.Insert(val)
|
|
||||||
}
|
|
||||||
|
|
||||||
return set
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self UniqueSet) Insert(k Stringable) UniqueSet {
|
|
||||||
self[k.String()] = struct{}{}
|
|
||||||
|
|
||||||
return self
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self UniqueSet) Include(k Stringable) bool {
|
|
||||||
_, ok := self[k.String()]
|
|
||||||
|
|
||||||
return ok
|
|
||||||
}
|
|
||||||
|
|
||||||
func Set(s Settable) UniqueSet {
|
|
||||||
return s.AsSet()
|
|
||||||
}
|
|
Loading…
Reference in New Issue