aboutsummaryrefslogtreecommitdiff
path: root/funcs.go
diff options
context:
space:
mode:
authorMatt Joiner <anacrolix@gmail.com>2020-10-01 11:10:09 +1000
committerMatt Joiner <anacrolix@gmail.com>2020-10-01 11:10:09 +1000
commit6efb032b54bd38efa98e6d39021a765d9997857c (patch)
treee5d92bd55e331a0e5be85dd7121ea30ba872ce9e /funcs.go
parentTidy up newTx usage and recycle from WouldBlock (diff)
downloadstm-6efb032b54bd38efa98e6d39021a765d9997857c.tar.gz
stm-6efb032b54bd38efa98e6d39021a765d9997857c.tar.xz
New Tx must have completed=false
This uncovers a race condition where new Tx are already marked completed.
Diffstat (limited to 'funcs.go')
-rw-r--r--funcs.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/funcs.go b/funcs.go
index b418cd7..91d6bc8 100644
--- a/funcs.go
+++ b/funcs.go
@@ -35,6 +35,7 @@ func init() {
func newTx() *Tx {
tx := txPool.Get().(*Tx)
tx.tries = 0
+ tx.completed = false
return tx
}