aboutsummaryrefslogtreecommitdiffstats
path: root/eth/handler.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-04-10 16:43:01 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-10 16:43:01 +0800
commitbfe5eb7f8c05c49563b0f1165f98d0a18f0fdbd4 (patch)
tree724676c86df67ae523cbfda2600e7ba466b2955d /eth/handler.go
parentf32b72ca5d7c477e5f5d3ab0d5b6548bf3fdc139 (diff)
downloadgo-tangerine-bfe5eb7f8c05c49563b0f1165f98d0a18f0fdbd4.tar.gz
go-tangerine-bfe5eb7f8c05c49563b0f1165f98d0a18f0fdbd4.tar.zst
go-tangerine-bfe5eb7f8c05c49563b0f1165f98d0a18f0fdbd4.zip
eth: accept transactions when starting CPU mining (#13882)
Diffstat (limited to 'eth/handler.go')
-rw-r--r--eth/handler.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/eth/handler.go b/eth/handler.go
index ef62a3d65..99c2c4b32 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -62,8 +62,8 @@ func errResp(code errCode, format string, v ...interface{}) error {
type ProtocolManager struct {
networkId int
- fastSync uint32 // Flag whether fast sync is enabled (gets disabled if we already have blocks)
- synced uint32 // Flag whether we're considered synchronised (enables transaction processing)
+ fastSync uint32 // Flag whether fast sync is enabled (gets disabled if we already have blocks)
+ acceptTxs uint32 // Flag whether we're considered synchronised (enables transaction processing)
txpool txPool
blockchain *core.BlockChain
@@ -171,7 +171,7 @@ func NewProtocolManager(config *params.ChainConfig, fastSync bool, networkId int
return blockchain.CurrentBlock().NumberU64()
}
inserter := func(blocks types.Blocks) (int, error) {
- atomic.StoreUint32(&manager.synced, 1) // Mark initial sync done on any fetcher import
+ atomic.StoreUint32(&manager.acceptTxs, 1) // Mark initial sync done on any fetcher import
return manager.blockchain.InsertChain(blocks)
}
manager.fetcher = fetcher.New(blockchain.GetBlockByHash, validator, manager.BroadcastBlock, heighter, inserter, manager.removePeer)
@@ -643,7 +643,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
case msg.Code == TxMsg:
// Transactions arrived, make sure we have a valid and fresh chain to handle them
- if atomic.LoadUint32(&pm.synced) == 0 {
+ if atomic.LoadUint32(&pm.acceptTxs) == 0 {
break
}
// Transactions can be processed, parse all of them and deliver to the pool