From 2ecb6ab7aef95f97012a6c1df53e562a2825c73c Mon Sep 17 00:00:00 2001 From: Domino Valdano Date: Tue, 3 Apr 2018 14:34:02 -0700 Subject: [PATCH] core: Fixed segfault in failing tests, due to false assumption of bc *Blockchain being non-nil. --- core/state_processor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/state_processor.go b/core/state_processor.go index fa5edbf550..812825d39a 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -126,7 +126,9 @@ func ApplyTransaction(config *params.ChainConfig, bc *BlockChain, author *common retData := types.ReturnData{TxHash: receipt.TxHash, Data: data, Removed: false} txPostEvent := TransactionEvent{TxHash: receipt.TxHash, RetData: retData} - go bc.txPostFeed.Send(&txPostEvent) + if bc != nil { // For some tests unrelated to tx events, this ptr can be nil; should always be non-nil in production + go bc.txPostFeed.Send(&txPostEvent) + } return receipt, gas, err }