mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
engine_v2: fix data race when initial v2 parameters, close XFN-10 (#1617)
This commit is contained in:
parent
689ac1b12a
commit
20ec25c0ca
1 changed files with 3 additions and 0 deletions
|
|
@ -178,6 +178,9 @@ func (x *XDPoS_v2) SignHash(header *types.Header) (hash common.Hash) {
|
||||||
|
|
||||||
// Initial V2 related parameters
|
// Initial V2 related parameters
|
||||||
func (x *XDPoS_v2) Initial(chain consensus.ChainReader, header *types.Header) error {
|
func (x *XDPoS_v2) Initial(chain consensus.ChainReader, header *types.Header) error {
|
||||||
|
x.lock.Lock()
|
||||||
|
defer x.lock.Unlock()
|
||||||
|
|
||||||
return x.initial(chain, header)
|
return x.initial(chain, header)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue