core, eth: minor txpool event cleanups
This commit is contained in:
@@ -46,7 +46,7 @@ const (
|
||||
softResponseLimit = 2 * 1024 * 1024 // Target maximum size of returned blocks, headers or node data.
|
||||
estHeaderRlpSize = 500 // Approximate size of an RLP encoded block header
|
||||
|
||||
// txChanSize is the size of channel listening to TxsPreEvent.
|
||||
// txChanSize is the size of channel listening to NewTxsEvent.
|
||||
// The number is referenced from the size of tx pool.
|
||||
txChanSize = 4096
|
||||
)
|
||||
@@ -81,7 +81,7 @@ type ProtocolManager struct {
|
||||
SubProtocols []p2p.Protocol
|
||||
|
||||
eventMux *event.TypeMux
|
||||
txsCh chan core.TxsPreEvent
|
||||
txsCh chan core.NewTxsEvent
|
||||
txsSub event.Subscription
|
||||
minedBlockSub *event.TypeMuxSubscription
|
||||
|
||||
@@ -204,8 +204,8 @@ func (pm *ProtocolManager) Start(maxPeers int) {
|
||||
pm.maxPeers = maxPeers
|
||||
|
||||
// broadcast transactions
|
||||
pm.txsCh = make(chan core.TxsPreEvent, txChanSize)
|
||||
pm.txsSub = pm.txpool.SubscribeTxPreEvent(pm.txsCh)
|
||||
pm.txsCh = make(chan core.NewTxsEvent, txChanSize)
|
||||
pm.txsSub = pm.txpool.SubscribeNewTxsEvent(pm.txsCh)
|
||||
go pm.txBroadcastLoop()
|
||||
|
||||
// broadcast mined blocks
|
||||
|
Reference in New Issue
Block a user