mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-26 08:26:20 +00:00
fixed error
This commit is contained in:
parent
83aba3424e
commit
b0cfa3037f
4 changed files with 12 additions and 16 deletions
|
|
@ -141,9 +141,9 @@ type BlockChain struct {
|
|||
validator Validator // block and state validator interface
|
||||
vmConfig vm.Config
|
||||
|
||||
badBlocks *lru.Cache // Bad block cache
|
||||
IPCEndpoint string
|
||||
Client *ethclient.Client // Global ipc client instance.
|
||||
badBlocks *lru.Cache // Bad block cache
|
||||
IPCEndpoint string
|
||||
Client *ethclient.Client // Global ipc client instance.
|
||||
}
|
||||
|
||||
// NewBlockChain returns a fully initialised block chain using information
|
||||
|
|
@ -1221,7 +1221,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Append a single chain head event if we've progressed the chain
|
||||
if lastCanon != nil && bc.CurrentBlock().Hash() == lastCanon.Hash() {
|
||||
|
|
@ -1428,9 +1427,8 @@ func (bc *BlockChain) insertBlock(block *types.Block) ([]interface{}, []*types.L
|
|||
events = append(events, ChainHeadEvent{block})
|
||||
log.Debug("New ChainHeadEvent from fetcher ", "number", block.NumberU64(), "hash", block.Hash())
|
||||
}
|
||||
|
||||
return events, coalescedLogs, nil
|
||||
}
|
||||
}
|
||||
|
||||
// insertStats tracks and reports on block insertion.
|
||||
type insertStats struct {
|
||||
|
|
@ -1660,11 +1658,9 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e
|
|||
log.Error(fmt.Sprintf(`
|
||||
########## BAD BLOCK #########
|
||||
Chain config: %v
|
||||
|
||||
Number: %v
|
||||
Hash: 0x%x
|
||||
%v
|
||||
|
||||
Error: %v
|
||||
##############################
|
||||
`, bc.chainConfig, block.Number(), block.Hash(), receiptString, err))
|
||||
|
|
@ -1872,4 +1868,4 @@ func (bc *BlockChain) UpdateM1() error {
|
|||
log.Info("Masternodes are ready for the next epoch")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
@ -366,7 +366,7 @@ func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
|||
common.BytesToAddress([]byte{6}): {Balance: big.NewInt(1)}, // ECAdd
|
||||
common.BytesToAddress([]byte{7}): {Balance: big.NewInt(1)}, // ECScalarMul
|
||||
common.BytesToAddress([]byte{8}): {Balance: big.NewInt(1)}, // ECPairing
|
||||
faucet: {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))},
|
||||
faucet: {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -612,12 +612,12 @@ func (self *worker) commitNewWork() {
|
|||
delete(self.possibleUncles, hash)
|
||||
}
|
||||
}
|
||||
// Create the new block to seal with the consensus engine
|
||||
if work.Block, err = self.engine.Finalize(self.chain, header, work.state, work.txs, uncles, work.receipts); err != nil {
|
||||
log.Error("Failed to finalize block for sealing", "err", err)
|
||||
return
|
||||
}
|
||||
if atomic.LoadInt32(&self.mining) == 1 {
|
||||
// Create the new block to seal with the consensus engine
|
||||
if work.Block, err = self.engine.Finalize(self.chain, header, work.state, work.txs, uncles, work.receipts); err != nil {
|
||||
log.Error("Failed to finalize block for sealing", "err", err)
|
||||
return
|
||||
}
|
||||
log.Info("Committing new block", "number", work.Block.Number(), "txs", work.tcount, "special txs", len(specialTxs), "uncles", len(uncles), "elapsed", common.PrettyDuration(time.Since(tstart)))
|
||||
self.unconfirmed.Shift(work.Block.NumberU64() - 1)
|
||||
self.lastParentBlockCommit = parent.Hash().Hex()
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ func initErrHandling() {
|
|||
multipleChoicesPage := GetMultipleChoicesErrorPage()
|
||||
//map the codes to the available pages
|
||||
tnames := map[int]string{
|
||||
0: genErrPage, //default
|
||||
0: genErrPage, //default
|
||||
http.StatusBadRequest: genErrPage,
|
||||
http.StatusNotFound: notFoundPage,
|
||||
http.StatusMultipleChoices: multipleChoicesPage,
|
||||
|
|
|
|||
Loading…
Reference in a new issue