diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-06 21:02:47 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-06 21:02:47 +0800 |
commit | 25e6c4eff8364770cfd2908db9c54a012b9e4ec4 (patch) | |
tree | 6e8284b8510b7f1deb1b96eb4f14c6a3283a7e25 | |
parent | a76b7dadaee6eddf64cba8ad8dd6ce71c785a7ee (diff) | |
download | dexon-25e6c4eff8364770cfd2908db9c54a012b9e4ec4.tar.gz dexon-25e6c4eff8364770cfd2908db9c54a012b9e4ec4.tar.zst dexon-25e6c4eff8364770cfd2908db9c54a012b9e4ec4.zip |
Adjusted difficulty and skip get tx messages
-rw-r--r-- | core/block_processor.go | 1 | ||||
-rw-r--r-- | core/chain_manager.go | 2 | ||||
-rw-r--r-- | eth/protocol.go | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/core/block_processor.go b/core/block_processor.go index 127e97921..233e5e4db 100644 --- a/core/block_processor.go +++ b/core/block_processor.go @@ -264,6 +264,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error { expd := CalcDifficulty(block, parent) if expd.Cmp(block.Header().Difficulty) < 0 { + fmt.Println("parent\n", parent) return fmt.Errorf("Difficulty check failed for block %v, %v", block.Header().Difficulty, expd) } diff --git a/core/chain_manager.go b/core/chain_manager.go index 82b17cd93..e73ea6378 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -25,7 +25,7 @@ func CalcDifficulty(block, parent *types.Block) *big.Int { bh, ph := block.Header(), parent.Header() adjust := new(big.Int).Rsh(ph.Difficulty, 10) - if bh.Time >= ph.Time+5 { + if bh.Time >= ph.Time+13 { diff.Sub(ph.Difficulty, adjust) } else { diff.Add(ph.Difficulty, adjust) diff --git a/eth/protocol.go b/eth/protocol.go index 723ab5502..736bcd94b 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -122,7 +122,7 @@ func (self *ethProtocol) handle() error { defer msg.Discard() switch msg.Code { - + case GetTxMsg: // ignore case StatusMsg: return self.protoError(ErrExtraStatusMsg, "") |