Fast forward to SF

This commit is contained in:
Tjaden Hess 2016-06-27 13:53:55 -04:00
parent 98be7cd833
commit 4dbdc8b08b
2 changed files with 42 additions and 38 deletions

View file

@ -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 {

View file

@ -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(),