mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
rename SenderCacher()
This commit is contained in:
parent
d078ad321c
commit
7b948bf3c1
3 changed files with 4 additions and 4 deletions
|
|
@ -1616,7 +1616,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness
|
||||||
return nil, 0, nil
|
return nil, 0, nil
|
||||||
}
|
}
|
||||||
// Start a parallel signature recovery (signer will fluke on fork transition, minimal perf loss)
|
// Start a parallel signature recovery (signer will fluke on fork transition, minimal perf loss)
|
||||||
GetSenderCacher().RecoverFromBlocks(types.MakeSigner(bc.chainConfig, chain[0].Number(), chain[0].Time()), chain)
|
SenderCacher().RecoverFromBlocks(types.MakeSigner(bc.chainConfig, chain[0].Number(), chain[0].Time()), chain)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
stats = insertStats{startTime: mclock.Now()}
|
stats = insertStats{startTime: mclock.Now()}
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,10 @@ var (
|
||||||
senderCacherInstance = newTxSenderCacher(runtime.NumCPU())
|
senderCacherInstance = newTxSenderCacher(runtime.NumCPU())
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetSenderCacher returns the singleton instance of SenderCacher.
|
// SenderCacher returns the singleton instance of SenderCacher.
|
||||||
// If the instance has not been initialized yet, it will be created using newTxSenderCacher.
|
// If the instance has not been initialized yet, it will be created using newTxSenderCacher.
|
||||||
// This function is thread-safe and ensures that initialization happens only once.
|
// This function is thread-safe and ensures that initialization happens only once.
|
||||||
func GetSenderCacher() *txSenderCacher {
|
func SenderCacher() *txSenderCacher {
|
||||||
senderCacherOnce.Do(func() {
|
senderCacherOnce.Do(func() {
|
||||||
senderCacherInstance = newTxSenderCacher(runtime.NumCPU())
|
senderCacherInstance = newTxSenderCacher(runtime.NumCPU())
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1440,7 +1440,7 @@ func (pool *LegacyPool) reset(oldHead, newHead *types.Header) {
|
||||||
|
|
||||||
// Inject any transactions discarded due to reorgs
|
// Inject any transactions discarded due to reorgs
|
||||||
log.Debug("Reinjecting stale transactions", "count", len(reinject))
|
log.Debug("Reinjecting stale transactions", "count", len(reinject))
|
||||||
core.GetSenderCacher().Recover(pool.signer, reinject)
|
core.SenderCacher().Recover(pool.signer, reinject)
|
||||||
pool.addTxsLocked(reinject, false)
|
pool.addTxsLocked(reinject, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue