diff --git a/Makefile b/Makefile index 6fc8f26071..906e8c06a0 100644 --- a/Makefile +++ b/Makefile @@ -180,6 +180,3 @@ debug_external: clean build_localnet_validator: bash test/build-localnet-validator.sh - -tt: - go test -v -test.run OnDisconnectCheck ./p2p/security \ No newline at end of file diff --git a/core/blockchain_impl.go b/core/blockchain_impl.go index b12de56373..e9eca1f4cd 100644 --- a/core/blockchain_impl.go +++ b/core/blockchain_impl.go @@ -1682,8 +1682,6 @@ func (bc *BlockChainImpl) insertChain(chain types.Blocks, verifyHeaders bool) (i if len(chain) == 0 { return 0, nil, nil, ErrEmptyChain } - first := chain[0] - fmt.Println("insertChain", utils.GetPort(), first.ShardID(), first.Epoch().Uint64(), first.NumberU64()) // Do a sanity check that the provided chain is actually ordered and linked for i := 1; i < len(chain); i++ { if chain[i].NumberU64() != chain[i-1].NumberU64()+1 || chain[i].ParentHash() != chain[i-1].Hash() { diff --git a/core/state_processor.go b/core/state_processor.go index 6ea9e244a6..9ccb256a78 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -310,7 +310,15 @@ func ApplyTransaction(bc ChainContext, author *common.Address, gp *GasPool, stat // Apply the transaction to the current state (included in the env) result, err := ApplyMessage(vmenv, msg, gp) if err != nil { - return nil, nil, nil, 0, errors.Wrapf(err, "apply failed from='%s' to='%s' balance='%s'", msg.From().Hex(), msg.To().Hex(), statedb.GetBalance(msg.From()).String()) + to := "" + if m := msg.To(); m != nil { + to = m.Hex() + } + balance := "" + if a := statedb.GetBalance(msg.From()); a != nil { + balance = a.String() + } + return nil, nil, nil, 0, errors.Wrapf(err, "apply failed from='%s' to='%s' balance='%s'", msg.From().Hex(), to, balance) } // Update the state with pending changes var root []byte