synchronize on trade during initialization

This commit is contained in:
woodser 2023-07-14 12:17:24 -04:00
parent a1829ee9f3
commit 9f3b0c96c4

View File

@ -573,6 +573,7 @@ public abstract class Trade implements Tradable, Model {
///////////////////////////////////////////////////////////////////////////////////////////
public void initialize(ProcessModelServiceProvider serviceProvider) {
synchronized (this) {
if (isInitialized) throw new IllegalStateException(getClass().getSimpleName() + " " + getId() + " is already initialized");
// set arbitrator pub key ring once known
@ -678,6 +679,7 @@ public abstract class Trade implements Tradable, Model {
if (xmrWalletService.getConnectionsService().getConnection() == null || Boolean.FALSE.equals(xmrWalletService.getConnectionsService().isConnected())) return;
updateSyncing();
}
}
public void requestPersistence() {
processModel.getTradeManager().requestPersistence();