Concurrent read/write during contract deployment

This commit is contained in:
Nguyen Sy Thanh Son 2019-07-10 09:24:08 +07:00 committed by GitHub
parent d8fc74e50e
commit ca40dbd8aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -346,7 +346,11 @@ func (self *worker) wait() {
for _, log := range work.state.Logs() {
log.BlockHash = block.Hash()
}
self.currentMu.Lock()
stat, err := self.chain.WriteBlockWithState(block, work.receipts, work.state)
self.currentMu.Unlock()
if err != nil {
log.Error("Failed writing block to chain", "err", err)
continue