From b84a422837cca994231fa36083f7b0104761b602 Mon Sep 17 00:00:00 2001 From: Tuna Date: Mon, 11 Mar 2019 18:57:43 +0700 Subject: [PATCH] handle SignHash error --- eth/backend.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eth/backend.go b/eth/backend.go index 16b360978f..843043fc51 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -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 }