mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
Fast forward to SF
This commit is contained in:
parent
98be7cd833
commit
4dbdc8b08b
2 changed files with 42 additions and 38 deletions
|
|
@ -268,6 +268,7 @@ func calcDifficultyHomestead(time, parentTime uint64, parentNumber, parentDiff *
|
|||
// (parent_diff / 2048 * max(1 - (block_timestamp - parent_timestamp) // 10, -99))
|
||||
// ) + 2^(periodCount - 2)
|
||||
|
||||
if (big.NewInt(1600000).Cmp(parentNumber) > 0 || big.NewInt(1799000).Cmp(parentNumber) < 0){
|
||||
bigTime := new(big.Int).SetUint64(time)
|
||||
bigParentTime := new(big.Int).SetUint64(parentTime)
|
||||
|
||||
|
|
@ -308,6 +309,9 @@ func calcDifficultyHomestead(time, parentTime uint64, parentNumber, parentDiff *
|
|||
}
|
||||
|
||||
return x
|
||||
} else {
|
||||
return big.NewInt(20000)
|
||||
}
|
||||
}
|
||||
|
||||
func calcDifficultyFrontier(time, parentTime uint64, parentNumber, parentDiff *big.Int) *big.Int {
|
||||
|
|
|
|||
|
|
@ -450,13 +450,13 @@ func (self *worker) commitNewWork() {
|
|||
if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) >= 0 {
|
||||
tstamp = parent.Time().Int64() + 1
|
||||
}
|
||||
// this will ensure we're not going off too far in the future
|
||||
/* // this will ensure we're not going off too far in the future
|
||||
if now := time.Now().Unix(); tstamp > now+4 {
|
||||
wait := time.Duration(tstamp-now) * time.Second
|
||||
glog.V(logger.Info).Infoln("We are too far in the future. Waiting for", wait)
|
||||
time.Sleep(wait)
|
||||
}
|
||||
|
||||
*/
|
||||
num := parent.Number()
|
||||
header := &types.Header{
|
||||
ParentHash: parent.Hash(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue