mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
remove fork point, check signHash != nil
This commit is contained in:
parent
3f2f8bdeb8
commit
7714a18330
2 changed files with 3 additions and 7 deletions
|
|
@ -1257,11 +1257,7 @@ func (bc *BlockChain) PrepareBlock(block *types.Block) (err error) {
|
||||||
log.Debug("Stop prepare a block because inserting", "number", block.NumberU64(), "hash", block.Hash(), "validator", block.Header().Validator)
|
log.Debug("Stop prepare a block because inserting", "number", block.NumberU64(), "hash", block.Hash(), "validator", block.Header().Validator)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var fullVerify bool = false
|
err = bc.engine.VerifyHeader(bc, block.Header(), false)
|
||||||
if bc.chainConfig.IsTIPSigning(block.Number()) {
|
|
||||||
fullVerify = true
|
|
||||||
}
|
|
||||||
err = bc.engine.VerifyHeader(bc, block.Header(), fullVerify)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,8 +247,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
header := block.Header()
|
header := block.Header()
|
||||||
sighash, err := wallet.SignHash(accounts.Account{Address: eb}, posv.SigHash(header).Bytes())
|
sighash, err := wallet.SignHash(accounts.Account{Address: eb}, posv.SigHash(header).Bytes())
|
||||||
if err != nil {
|
if err != nil || sighash == nil {
|
||||||
log.Error("Can't get signature hash of m2", "err", err)
|
log.Error("Can't get signature hash of m2", "sighash", sighash, "err", err)
|
||||||
return block, false, err
|
return block, false, err
|
||||||
}
|
}
|
||||||
header.Validator = sighash
|
header.Validator = sighash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue