|
@@ -630,7 +630,7 @@ func (bc *BlockChain) FastSyncCommitHead(hash common.Hash) error {
|
|
|
// Make sure that both the block as well at its state trie exists
|
|
// Make sure that both the block as well at its state trie exists
|
|
|
block := bc.GetBlockByHash(hash)
|
|
block := bc.GetBlockByHash(hash)
|
|
|
if block == nil {
|
|
if block == nil {
|
|
|
- return fmt.Errorf("non existent block [%x…]", hash[:4])
|
|
|
|
|
|
|
+ return fmt.Errorf("non existent block [%x..]", hash[:4])
|
|
|
}
|
|
}
|
|
|
if _, err := trie.NewSecure(block.Root(), bc.stateCache.TrieDB()); err != nil {
|
|
if _, err := trie.NewSecure(block.Root(), bc.stateCache.TrieDB()); err != nil {
|
|
|
return err
|
|
return err
|
|
@@ -1147,7 +1147,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
|
|
|
if blockChain[i].NumberU64() != blockChain[i-1].NumberU64()+1 || blockChain[i].ParentHash() != blockChain[i-1].Hash() {
|
|
if blockChain[i].NumberU64() != blockChain[i-1].NumberU64()+1 || blockChain[i].ParentHash() != blockChain[i-1].Hash() {
|
|
|
log.Error("Non contiguous receipt insert", "number", blockChain[i].Number(), "hash", blockChain[i].Hash(), "parent", blockChain[i].ParentHash(),
|
|
log.Error("Non contiguous receipt insert", "number", blockChain[i].Number(), "hash", blockChain[i].Hash(), "parent", blockChain[i].ParentHash(),
|
|
|
"prevnumber", blockChain[i-1].Number(), "prevhash", blockChain[i-1].Hash())
|
|
"prevnumber", blockChain[i-1].Number(), "prevhash", blockChain[i-1].Hash())
|
|
|
- return 0, fmt.Errorf("non contiguous insert: item %d is #%d [%x…], item %d is #%d [%x…] (parent [%x…])", i-1, blockChain[i-1].NumberU64(),
|
|
|
|
|
|
|
+ return 0, fmt.Errorf("non contiguous insert: item %d is #%d [%x..], item %d is #%d [%x..] (parent [%x..])", i-1, blockChain[i-1].NumberU64(),
|
|
|
blockChain[i-1].Hash().Bytes()[:4], i, blockChain[i].NumberU64(), blockChain[i].Hash().Bytes()[:4], blockChain[i].ParentHash().Bytes()[:4])
|
|
blockChain[i-1].Hash().Bytes()[:4], i, blockChain[i].NumberU64(), blockChain[i].Hash().Bytes()[:4], blockChain[i].ParentHash().Bytes()[:4])
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1212,7 +1212,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
|
|
|
}
|
|
}
|
|
|
// Short circuit if the owner header is unknown
|
|
// Short circuit if the owner header is unknown
|
|
|
if !bc.HasHeader(block.Hash(), block.NumberU64()) {
|
|
if !bc.HasHeader(block.Hash(), block.NumberU64()) {
|
|
|
- return i, fmt.Errorf("containing header #%d [%x…] unknown", block.Number(), block.Hash().Bytes()[:4])
|
|
|
|
|
|
|
+ return i, fmt.Errorf("containing header #%d [%x..] unknown", block.Number(), block.Hash().Bytes()[:4])
|
|
|
}
|
|
}
|
|
|
var (
|
|
var (
|
|
|
start = time.Now()
|
|
start = time.Now()
|
|
@@ -1356,7 +1356,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
|
|
|
}
|
|
}
|
|
|
// Short circuit if the owner header is unknown
|
|
// Short circuit if the owner header is unknown
|
|
|
if !bc.HasHeader(block.Hash(), block.NumberU64()) {
|
|
if !bc.HasHeader(block.Hash(), block.NumberU64()) {
|
|
|
- return i, fmt.Errorf("containing header #%d [%x…] unknown", block.Number(), block.Hash().Bytes()[:4])
|
|
|
|
|
|
|
+ return i, fmt.Errorf("containing header #%d [%x..] unknown", block.Number(), block.Hash().Bytes()[:4])
|
|
|
}
|
|
}
|
|
|
if !skipPresenceCheck {
|
|
if !skipPresenceCheck {
|
|
|
// Ignore if the entire data is already known
|
|
// Ignore if the entire data is already known
|
|
@@ -1679,7 +1679,7 @@ func (bc *BlockChain) InsertChain(chain types.Blocks) (int, error) {
|
|
|
log.Error("Non contiguous block insert", "number", block.Number(), "hash", block.Hash(),
|
|
log.Error("Non contiguous block insert", "number", block.Number(), "hash", block.Hash(),
|
|
|
"parent", block.ParentHash(), "prevnumber", prev.Number(), "prevhash", prev.Hash())
|
|
"parent", block.ParentHash(), "prevnumber", prev.Number(), "prevhash", prev.Hash())
|
|
|
|
|
|
|
|
- return 0, fmt.Errorf("non contiguous insert: item %d is #%d [%x…], item %d is #%d [%x…] (parent [%x…])", i-1, prev.NumberU64(),
|
|
|
|
|
|
|
+ return 0, fmt.Errorf("non contiguous insert: item %d is #%d [%x..], item %d is #%d [%x..] (parent [%x..])", i-1, prev.NumberU64(),
|
|
|
prev.Hash().Bytes()[:4], i, block.NumberU64(), block.Hash().Bytes()[:4], block.ParentHash().Bytes()[:4])
|
|
prev.Hash().Bytes()[:4], i, block.NumberU64(), block.Hash().Bytes()[:4], block.ParentHash().Bytes()[:4])
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|