Closed PaulBernier closed 4 years ago
Agreed, this is an easy fix. Currently I don't think the jsonrpc client of the factom library checks the ID field at all so this would never result in an error but if that functionality ever gets implemented, this piece won't be broken.
Submitting PR shortly
The APICounter is not thread safe and generates a warning by the Golang race condition detector:
Current implementation: https://github.com/FactomProject/factom/blob/master/jsonrpc.go#L331
It most likely has a very little or no actual impact, but having the warning show up for people using the factom lib is unnecessary noise. Golang provides out of the box some primitive for atomic counters that could be leveraged: https://gobyexample.com/atomic-counters