core: Fixed segfault in failing tests, due to false assumption of bc *Blockchain being non-nil.

This commit is contained in:
Domino Valdano 2018-04-03 14:34:02 -07:00
parent 169c590b07
commit 2ecb6ab7ae
No known key found for this signature in database
GPG key ID: 3FDFE30EE92AC05E

View file

@ -126,7 +126,9 @@ func ApplyTransaction(config *params.ChainConfig, bc *BlockChain, author *common
retData := types.ReturnData{TxHash: receipt.TxHash, Data: data, Removed: false} retData := types.ReturnData{TxHash: receipt.TxHash, Data: data, Removed: false}
txPostEvent := TransactionEvent{TxHash: receipt.TxHash, RetData: retData} 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 return receipt, gas, err
} }