mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
core: recover all signatures before processing block
All EC signatures are recovered in seperate goroutines prior to executing the block.
This commit is contained in:
parent
a38f3740d6
commit
84128dda95
1 changed files with 9 additions and 0 deletions
|
|
@ -582,6 +582,15 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bstart := time.Now()
|
bstart := time.Now()
|
||||||
|
|
||||||
|
// Recover signatures in parallel
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
wg.Add(len(block.Transactions()))
|
||||||
|
for _, tx := range block.Transactions() {
|
||||||
|
go func(tx *types.Transaction) { defer wg.Done(); tx.From() }(tx)
|
||||||
|
}
|
||||||
|
wg.Wait()
|
||||||
|
|
||||||
// Wait for block i's nonce to be verified before processing
|
// Wait for block i's nonce to be verified before processing
|
||||||
// its state transition.
|
// its state transition.
|
||||||
for !nonceChecked[i] {
|
for !nonceChecked[i] {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue