Merge pull request #358 from dinhln89/half-mn

Remove comment redudant code for issue https://github.com/tomochain/tomochain/pull/343
This commit is contained in:
Tuna 2018-12-24 17:45:40 +07:00 committed by GitHub
commit 2a95e684bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 8 deletions

View file

@ -28,6 +28,7 @@ import (
"unicode" "unicode"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/dashboard" "github.com/ethereum/go-ethereum/dashboard"
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/internal/debug" "github.com/ethereum/go-ethereum/internal/debug"
@ -36,7 +37,6 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/naoina/toml" "github.com/naoina/toml"
"github.com/ethereum/go-ethereum/common"
) )
var ( var (

View file

@ -480,7 +480,6 @@ func (c *Posv) YourTurn(chain consensus.ChainReader, parent *types.Header, signe
// Only three mns for tomo testnet. // Only three mns for tomo testnet.
masternodes = masternodes[:3] masternodes = masternodes[:3]
} }
log.Error("masternodes", "masternodes", len(masternodes))
snap, err := c.GetSnapshot(chain, parent) snap, err := c.GetSnapshot(chain, parent)
if err != nil { if err != nil {
log.Warn("Failed when trying to commit new work", "err", err) log.Warn("Failed when trying to commit new work", "err", err)

View file

@ -127,11 +127,11 @@ type BlockChain struct {
bodyRLPCache *lru.Cache // Cache for the most recent block bodies in RLP encoded format bodyRLPCache *lru.Cache // Cache for the most recent block bodies in RLP encoded format
blockCache *lru.Cache // Cache for the most recent entire blocks blockCache *lru.Cache // Cache for the most recent entire blocks
futureBlocks *lru.Cache // future blocks are blocks added for later processing futureBlocks *lru.Cache // future blocks are blocks added for later processing
resultProcess *lru.Cache // Cache for processed blocks resultProcess *lru.Cache // Cache for processed blocks
calculatingBlock *lru.Cache // Cache for processing blocks calculatingBlock *lru.Cache // Cache for processing blocks
downloadingBlock *lru.Cache // Cache for downloading blocks (avoid duplication from fetcher) downloadingBlock *lru.Cache // Cache for downloading blocks (avoid duplication from fetcher)
quit chan struct{} // blockchain quit channel quit chan struct{} // blockchain quit channel
running int32 // running must be called atomically running int32 // running must be called atomically
// procInterrupt must be atomically called // procInterrupt must be atomically called
procInterrupt int32 // interrupt signaler for block processing procInterrupt int32 // interrupt signaler for block processing
wg sync.WaitGroup // chain processing wait group for shutting down wg sync.WaitGroup // chain processing wait group for shutting down

View file

@ -497,7 +497,7 @@ func (self *worker) commitNewWork() {
if self.config.Posv != nil { if self.config.Posv != nil {
// get masternodes set from latest checkpoint // get masternodes set from latest checkpoint
c := self.engine.(*posv.Posv) c := self.engine.(*posv.Posv)
len, preIndex, curIndex, ok, err := c.YourTurn(self.chain, parent.Header(),self.coinbase) len, preIndex, curIndex, ok, err := c.YourTurn(self.chain, parent.Header(), self.coinbase)
if err != nil { if err != nil {
log.Warn("Failed when trying to commit new work", "err", err) log.Warn("Failed when trying to commit new work", "err", err)
return return