Skip to content

Commit

Permalink
Merge pull request #1969 from jyellick/fix-busywork-master-nondetermi…
Browse files Browse the repository at this point in the history
…nism

Fix busywork counters non-determinism
  • Loading branch information
srderson committed Jun 23, 2016
2 parents 1ec4606 + 5539096 commit 474bf39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/busywork/counters/counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ func (c *counters) incDec(stub *shim.ChaincodeStub, args []string, incr int) (va
count := c.count[name]
counters := arrays[name]
offset[name] = offset[name] * uint64(incr)
new := count + offset[name]
c.debugf("incDec : Array %s has count %d and offset %d", name, count, offset[name])
for i, v := range counters {
if c.checkCounters && (v != count) {
c.criticalf("incDec : Element %s[%d] has value %d; Expected %d", name, i, v, count)
}
new := v + offset[name]
c.debugf("incDec : %s[%d] <- %d", name, i, new)
counters[i] = new
}
Expand Down

0 comments on commit 474bf39

Please sign in to comment.