Skip to content
Permalink
Browse files

fix Less rewarding

  • Loading branch information...
luomijie committed Mar 14, 2019
1 parent de82e91 commit 96797087286ac9dfa884b457f80bd89236ac6b37
Showing with 13 additions and 13 deletions.
  1. +13 −13 consensus/devote/devote.go
@@ -531,7 +531,7 @@ func (d *Devote) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
}
// Don't hold the signer fields for the entire sealing procedure
d.lock.RLock()
signer, signFn := d.signer, d.signFn
_, signFn := d.signer, d.signFn
d.lock.RUnlock()
// Bail out if we're unauthorized to sign a block
snap, err := d.snapshot(chain, number-1, header.ParentHash, nil)
@@ -545,18 +545,18 @@ func (d *Devote) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
if diff > 30 {
snap.Recents = make(map[uint64]string)
}
singerMap := snap.Signers
// If we're amongst the recent signers, wait for the next block
for seen, recent := range snap.Recents {
if recent == signer {
// Signer is among recents, only wait if the current block doesn't shift it out
if limit := uint64(len(singerMap)/2 + 1); number < limit || seen > number-limit {
log.Info("Signed recently, must wait for others, ", "signer", signer, "seen", seen, "number", number, "limit", limit)
return nil, nil
}
log.Info("Passed Signed recently, ", "signer", signer, "seen", seen, "number", number, "limit", uint64(len(singerMap)/2+1))
}
}
//singerMap := snap.Signers
//// If we're amongst the recent signers, wait for the next block
//for seen, recent := range snap.Recents {
// if recent == signer {
// // Signer is among recents, only wait if the current block doesn't shift it out
// if limit := uint64(len(singerMap)/2 + 1); number < limit || seen > number-limit {
// log.Info("Signed recently, must wait for others, ", "signer", signer, "seen", seen, "number", number, "limit", limit)
// return nil, nil
// }
// log.Info("Passed Signed recently, ", "signer", signer, "seen", seen, "number", number, "limit", uint64(len(singerMap)/2+1))
// }
//}

NextSlot := int64(NextSlot(uint64(now)))
delay := NextSlot - now

0 comments on commit 9679708

Please sign in to comment.
You can’t perform that action at this time.