Skip to content

Commit

Permalink
blockchain.go: add prints
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorwick committed Jul 19, 2022
1 parent 1d264f5 commit 8fb5c20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions consensus/blake3/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ func (blake3 *Blake3) PreviousCoincidentOnPath(chain consensus.ChainHeaderReader
// Get previous header on local chain by hash
prevHeader := chain.GetHeaderByHash(header.ParentHash[path])
if prevHeader == nil {
fmt.Println("unable to find", prevHeader.ParentHash[path], path)
return nil, consensus.ErrSubordinateNotSynced
}
// Increment previous header
Expand Down
4 changes: 1 addition & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2981,11 +2981,9 @@ func (bc *BlockChain) GetExternalBlock(hash common.Hash, location []byte, contex

// requestExternalBlock sends an external block event to the missingExternalBlockFeed in order to be fulfilled by a manager or client.
func (bc *BlockChain) requestExternalBlock(hash common.Hash, blockContext uint64) *types.ExternalBlock {
fmt.Println("requesting external block")
if bc.domClient != nil {
extBlock := FindExternalBlock(bc.domClient, hash, blockContext)
if extBlock != nil {
fmt.Println("found", extBlock.Hash())
return extBlock
}
}
Expand All @@ -2994,7 +2992,6 @@ func (bc *BlockChain) requestExternalBlock(hash common.Hash, blockContext uint64
if client != nil {
extBlock := FindExternalBlock(client, hash, blockContext)
if extBlock != nil {
fmt.Println("found", extBlock.Hash())
return extBlock
}
}
Expand Down Expand Up @@ -3475,6 +3472,7 @@ func (bc *BlockChain) CheckCanonical(header *types.Header, order int) error {
switch status {
case quaiclient.CanonStatTy:
if (lastUncleHash != common.Hash{}) {
fmt.Println("header", header.Number, header.Hash(), lastUncleHeader.Number, lastUncleHash)
bc.ReOrgRollBack(lastUncleHeader, []*types.Header{}, []*types.Header{})
return consensus.ErrSubordinateNotSynced
}
Expand Down

0 comments on commit 8fb5c20

Please sign in to comment.