diff options
-rw-r--r-- | build/ci.go | 5 | ||||
-rw-r--r-- | core/blockchain.go | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/build/ci.go b/build/ci.go index 05e95b0f1..4ff63fd7f 100644 --- a/build/ci.go +++ b/build/ci.go @@ -930,9 +930,9 @@ func doXgo(cmdline []string) { // If all tools building is requested, build everything the builder wants args := append(buildFlags(env), flag.Args()...) - args = append(args, []string{"--dest", GOBIN}...) if *alltools { + args = append(args, []string{"--dest", GOBIN}...) for _, res := range allToolsArchiveFiles { if strings.HasPrefix(res, GOBIN) { // Binary tool found, cross build it explicitly @@ -945,6 +945,9 @@ func doXgo(cmdline []string) { return } // Otherwise xxecute the explicit cross compilation + path := args[len(args)-1] + args = append(args[:len(args)-1], []string{"--dest", GOBIN, path}...) + xgo := xgoTool(args) build.MustRun(xgo) } diff --git a/core/blockchain.go b/core/blockchain.go index 2a59bb2e7..0c752b3f9 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1143,13 +1143,16 @@ func (self *BlockChain) reorg(oldBlock, newBlock *types.Block) error { } } // Ensure the user sees large reorgs - logFn := log.Debug - if len(oldChain) > 63 { - logFn = log.Warn + if len(oldChain) > 0 && len(newChain) > 0 { + logFn := log.Debug + if len(oldChain) > 63 { + logFn = log.Warn + } + logFn("Chain split detected", "number", commonBlock.Number(), "hash", commonBlock.Hash(), + "drop", len(oldChain), "dropfrom", oldChain[0].Hash(), "add", len(newChain), "addfrom", newChain[0].Hash()) + } else { + log.Error("Impossible reorg, please file an issue", "oldnum", oldBlock.Number(), "oldhash", oldBlock.Hash(), "newnum", newBlock.Number(), "newhash", newBlock.Hash()) } - logFn("Chain split detected", "number", commonBlock.Number(), "hash", commonBlock.Hash(), - "drop", len(oldChain), "dropfrom", oldChain[0].Hash(), "add", len(newChain), "addfrom", newChain[0].Hash()) - var addedTxs types.Transactions // insert blocks. Order does not matter. Last block will be written in ImportChain itself which creates the new head properly for _, block := range newChain { |