Skip to content

Commit b0fb48c

Browse files
committed
Merge pull request ethereum#1988 from bas-vk/issue1971
miner: bugfix where blockhash in receipts and logs is left empty
2 parents ae9e9ef + 98cbe13 commit b0fb48c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

miner/worker.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,17 @@ func (self *worker) wait() {
302302
glog.V(logger.Error).Infoln("error writing block to chain", err)
303303
continue
304304
}
305+
306+
// update block hash since it is now available and not when the receipt/log of individual transactions were created
307+
for _, r := range work.receipts {
308+
for _, l := range r.Logs {
309+
l.BlockHash = block.Hash()
310+
}
311+
}
312+
for _, log := range work.state.Logs() {
313+
log.BlockHash = block.Hash()
314+
}
315+
305316
// check if canon block and write transactions
306317
if stat == core.CanonStatTy {
307318
// This puts transactions in a extra db for rpc

0 commit comments

Comments
 (0)