dcrdex
dcrdex copied to clipboard
core: protect epoch checksum with its own mutex
The trackedTrade.csum field was protected under the very broad trackedTrade.mtx. This created lock contention when preimage requests came in for cancel orders while we had long running ticks, since acceptCsum had to lock that mutex. With this change, we now protect the checksum fields for trades and cancels under a different mutex.
Additionally, there were two places where the trackedTrade.cancel field was being read unsafely. A solution for that is implemented.
Closes #2964 Supercedes #2973