diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-06 19:29:06 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-06 19:29:06 +0800 |
commit | 74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6 (patch) | |
tree | e3611a7b492b7ed9a359fa3100939853f6f8f6ae | |
parent | 82ef26f6007986debd6ce082f57050f0c7e36006 (diff) | |
download | go-tangerine-74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6.tar go-tangerine-74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6.tar.gz go-tangerine-74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6.tar.bz2 go-tangerine-74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6.tar.lz go-tangerine-74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6.tar.xz go-tangerine-74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6.tar.zst go-tangerine-74f6d90153a4d62eefaa8a49f98dc6ed8e0100f6.zip |
cmd/utils, core: disable exp diff for olympic net
-rw-r--r-- | cmd/utils/cmd.go | 2 | ||||
-rw-r--r-- | core/chain_util.go | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index f8f7f6376..983762db8 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -21,6 +21,7 @@ import ( "bufio" "fmt" "io" + "math" "math/big" "os" "os/signal" @@ -152,6 +153,7 @@ func InitOlympic() { params.MaximumExtraDataSize = big.NewInt(1024) NetworkIdFlag.Value = 0 core.BlockReward = big.NewInt(1.5e+18) + core.ExpDiffPeriod = big.NewInt(math.MaxInt64) } func FormatTransactionData(data string) []byte { diff --git a/core/chain_util.go b/core/chain_util.go index 34f6c8d0a..84b462ce3 100644 --- a/core/chain_util.go +++ b/core/chain_util.go @@ -32,7 +32,7 @@ import ( var ( blockHashPre = []byte("block-hash-") blockNumPre = []byte("block-num-") - expDiffPeriod = big.NewInt(100000) + ExpDiffPeriod = big.NewInt(100000) ) // CalcDifficulty is the difficulty adjustment algorithm. It returns @@ -57,7 +57,7 @@ func CalcDifficulty(time, parentTime uint64, parentNumber, parentDiff *big.Int) } periodCount := new(big.Int).Add(parentNumber, common.Big1) - periodCount.Div(periodCount, expDiffPeriod) + periodCount.Div(periodCount, ExpDiffPeriod) if periodCount.Cmp(common.Big1) > 0 { // diff = diff + 2^(periodCount - 2) expDiff := periodCount.Sub(periodCount, common.Big2) |