good morning!!!!

Skip to content
Snippets Groups Projects
Commit 25e6c4ef authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Adjusted difficulty and skip get tx messages

parent a76b7dad
No related branches found
No related tags found
No related merge requests found
......@@ -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)
}
......
......@@ -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)
......
......@@ -122,7 +122,7 @@ func (self *ethProtocol) handle() error {
defer msg.Discard()
switch msg.Code {
case GetTxMsg: // ignore
case StatusMsg:
return self.protoError(ErrExtraStatusMsg, "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment