NetworkParameters: Make double-checked locking on defaultSerializer safe with volatile keyword.

This commit is contained in:
Matthew Leon
2019-03-25 22:14:32 -04:00
committed by Andreas Schildbach
parent 9d1cff1de1
commit be40b7a3e5

View File

@@ -107,7 +107,7 @@ public abstract class NetworkParameters {
protected int[] addrSeeds;
protected HttpDiscovery.Details[] httpSeeds = {};
protected Map<Integer, Sha256Hash> checkpoints = new HashMap<>();
protected transient MessageSerializer defaultSerializer = null;
protected volatile transient MessageSerializer defaultSerializer = null;
protected NetworkParameters() {
alertSigningKey = SATOSHI_KEY;