aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_manager.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-02 23:32:02 +0800
committerobscuren <geffobscura@gmail.com>2015-03-02 23:32:02 +0800
commitb383ff0b96a1cf3df0b56f13b8d303ae4d4977ad (patch)
tree6af5b54d74402e2c31ea083981d215c0701832f4 /core/chain_manager.go
parent73c52d1677ba526385f1b223ef48f3a26091fe00 (diff)
downloadgo-tangerine-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar
go-tangerine-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.gz
go-tangerine-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.bz2
go-tangerine-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.lz
go-tangerine-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.xz
go-tangerine-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.tar.zst
go-tangerine-b383ff0b96a1cf3df0b56f13b8d303ae4d4977ad.zip
New gas prices model
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r--core/chain_manager.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 959bfd398..2f6c36382 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -28,11 +28,13 @@ type StateQuery interface {
func CalcDifficulty(block, parent *types.Block) *big.Int {
diff := new(big.Int)
- adjust := new(big.Int).Rsh(parent.Difficulty(), 10)
- if block.Time() >= parent.Time()+8 {
- diff.Sub(parent.Difficulty(), adjust)
- } else {
+ //adjust := new(big.Int).Rsh(parent.Difficulty(), 10)
+ //if block.Time() >= parent.Time()+8 {
+ adjust := new(big.Int).Div(parent.Difficulty(), big.NewInt(2048))
+ if (block.Time() - parent.Time()) < 8 {
diff.Add(parent.Difficulty(), adjust)
+ } else {
+ diff.Sub(parent.Difficulty(), adjust)
}
return diff