mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +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
|
validator Validator // block and state validator interface
|
||||||
vmConfig vm.Config
|
vmConfig vm.Config
|
||||||
|
|
||||||
badBlocks *lru.Cache // Bad block cache
|
badBlocks *lru.Cache // Bad block cache
|
||||||
IPCEndpoint string
|
IPCEndpoint string
|
||||||
Client *ethclient.Client // Global ipc client instance.
|
Client *ethclient.Client // Global ipc client instance.
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlockChain returns a fully initialised block chain using information
|
// 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
|
// Append a single chain head event if we've progressed the chain
|
||||||
if lastCanon != nil && bc.CurrentBlock().Hash() == lastCanon.Hash() {
|
if lastCanon != nil && bc.CurrentBlock().Hash() == lastCanon.Hash() {
|
||||||
|
|
@ -1428,7 +1427,6 @@ func (bc *BlockChain) insertBlock(block *types.Block) ([]interface{}, []*types.L
|
||||||
events = append(events, ChainHeadEvent{block})
|
events = append(events, ChainHeadEvent{block})
|
||||||
log.Debug("New ChainHeadEvent from fetcher ", "number", block.NumberU64(), "hash", block.Hash())
|
log.Debug("New ChainHeadEvent from fetcher ", "number", block.NumberU64(), "hash", block.Hash())
|
||||||
}
|
}
|
||||||
|
|
||||||
return events, coalescedLogs, nil
|
return events, coalescedLogs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1660,11 +1658,9 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e
|
||||||
log.Error(fmt.Sprintf(`
|
log.Error(fmt.Sprintf(`
|
||||||
########## BAD BLOCK #########
|
########## BAD BLOCK #########
|
||||||
Chain config: %v
|
Chain config: %v
|
||||||
|
|
||||||
Number: %v
|
Number: %v
|
||||||
Hash: 0x%x
|
Hash: 0x%x
|
||||||
%v
|
%v
|
||||||
|
|
||||||
Error: %v
|
Error: %v
|
||||||
##############################
|
##############################
|
||||||
`, bc.chainConfig, block.Number(), block.Hash(), receiptString, err))
|
`, bc.chainConfig, block.Number(), block.Hash(), receiptString, err))
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@ func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
||||||
common.BytesToAddress([]byte{6}): {Balance: big.NewInt(1)}, // ECAdd
|
common.BytesToAddress([]byte{6}): {Balance: big.NewInt(1)}, // ECAdd
|
||||||
common.BytesToAddress([]byte{7}): {Balance: big.NewInt(1)}, // ECScalarMul
|
common.BytesToAddress([]byte{7}): {Balance: big.NewInt(1)}, // ECScalarMul
|
||||||
common.BytesToAddress([]byte{8}): {Balance: big.NewInt(1)}, // ECPairing
|
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)
|
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 {
|
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)))
|
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.unconfirmed.Shift(work.Block.NumberU64() - 1)
|
||||||
self.lastParentBlockCommit = parent.Hash().Hex()
|
self.lastParentBlockCommit = parent.Hash().Hex()
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ func initErrHandling() {
|
||||||
multipleChoicesPage := GetMultipleChoicesErrorPage()
|
multipleChoicesPage := GetMultipleChoicesErrorPage()
|
||||||
//map the codes to the available pages
|
//map the codes to the available pages
|
||||||
tnames := map[int]string{
|
tnames := map[int]string{
|
||||||
0: genErrPage, //default
|
0: genErrPage, //default
|
||||||
http.StatusBadRequest: genErrPage,
|
http.StatusBadRequest: genErrPage,
|
||||||
http.StatusNotFound: notFoundPage,
|
http.StatusNotFound: notFoundPage,
|
||||||
http.StatusMultipleChoices: multipleChoicesPage,
|
http.StatusMultipleChoices: multipleChoicesPage,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue