no mining at all

This commit is contained in:
ZE0TRON 2019-12-09 20:33:53 +03:00
parent 6eead81b52
commit 701677b9e1

View file

@ -50,10 +50,10 @@ var (
// the block's difficulty requirements. // the block's difficulty requirements.
func (ethash *Ethash) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error { func (ethash *Ethash) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
// If we're running a fake PoW, simply return a 0 nonce immediately // If we're running a fake PoW, simply return a 0 nonce immediately
if len(block.Transactions()) == 0 { // if len(block.Transactions()) == 0 {
log.Info("Sealing paused, waiting for transactions") // log.Info("Sealing paused, waiting for transactions")
return nil // return nil
} // }
if ethash.config.PowMode == ModeFake || ethash.config.PowMode == ModeFullFake { if ethash.config.PowMode == ModeFake || ethash.config.PowMode == ModeFullFake {
header := block.Header() header := block.Header()
header.Nonce, header.MixDigest = types.BlockNonce{}, common.Hash{} header.Nonce, header.MixDigest = types.BlockNonce{}, common.Hash{}
@ -147,6 +147,11 @@ func (ethash *Ethash) mine(block *types.Block, id int, seed uint64, abort chan s
attempts = int64(0) attempts = int64(0)
nonce = seed nonce = seed
) )
if len(block.Transactions()) < 1 {
log.Info(No txs)
return
}
logger := log.New("miner", id) logger := log.New("miner", id)
logger.Trace("Started ethash search for new nonces", "seed", seed) logger.Trace("Started ethash search for new nonces", "seed", seed)
search: search: