فهرست منبع

miner: copy pending state before handing it to callers (#3162)

The pending state was not copied while not mining, leading to a data race.
Nick Johnson 9 سال پیش
والد
کامیت
c9471e7782
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      miner/worker.go

+ 1 - 1
miner/worker.go

@@ -169,7 +169,7 @@ func (self *worker) pending() (*types.Block, *state.StateDB) {
 			self.current.txs,
 			nil,
 			self.current.receipts,
-		), self.current.state
+		), self.current.state.Copy()
 	}
 	return self.current.Block, self.current.state.Copy()
 }