mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
no mining at all
This commit is contained in:
parent
6eead81b52
commit
701677b9e1
1 changed files with 9 additions and 4 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue