From 98cbe1356e17f761279228ef25564eac900ad6ef Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Thu, 19 Nov 2015 16:02:49 +0100 Subject: miner: bugfix were blockhash in receipts and logs is left empty --- miner/worker.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'miner') diff --git a/miner/worker.go b/miner/worker.go index aa0fa85cb..754a6fc48 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -302,6 +302,17 @@ func (self *worker) wait() { glog.V(logger.Error).Infoln("error writing block to chain", err) continue } + + // update block hash since it is now available and not when the receipt/log of individual transactions were created + for _, r := range work.receipts { + for _, l := range r.Logs { + l.BlockHash = block.Hash() + } + } + for _, log := range work.state.Logs() { + log.BlockHash = block.Hash() + } + // check if canon block and write transactions if stat == core.CanonStatTy { // This puts transactions in a extra db for rpc -- cgit v1.2.3