mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
handle SignHash error
This commit is contained in:
parent
5ca030d513
commit
b84a422837
1 changed files with 8 additions and 2 deletions
|
|
@ -240,9 +240,15 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
|||
return block, false, fmt.Errorf("can't get block validator: %v", err)
|
||||
}
|
||||
if m2 == eb {
|
||||
wallet, _ := eth.accountManager.Find(accounts.Account{Address: eb})
|
||||
wallet, err := eth.accountManager.Find(accounts.Account{Address: eb})
|
||||
if err != nil {
|
||||
return block, false, err
|
||||
}
|
||||
header := block.Header()
|
||||
sighash, _ := 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 {
|
||||
return block, false, err
|
||||
}
|
||||
header.Validator = sighash
|
||||
return types.NewBlockWithHeader(header).WithBody(block.Transactions(), block.Uncles()), true, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue