shutting down TorNetworkNode invokes callback handler if already complete

This commit is contained in:
woodser 2023-07-26 09:26:06 -04:00
parent c39c5cf387
commit c548fdaf29
6 changed files with 26 additions and 18 deletions

View file

@ -1137,7 +1137,7 @@ public abstract class Trade implements Tradable, Model {
}
public void shutDown() {
if (wallet != null) log.info("{} {} shutting down", getClass().getSimpleName(), getId());
if (!isPayoutUnlocked()) log.info("{} {} shutting down", getClass().getSimpleName(), getId());
synchronized (this) {
isInitialized = false;
isShutDown = true;

View file

@ -322,10 +322,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
private void closeAllTrades() {
// collect trades to shutdown
Set<Trade> trades = new HashSet<Trade>();
trades.addAll(tradableList.getList());
trades.addAll(closedTradableManager.getClosedTrades());
trades.addAll(failedTradesManager.getObservableList());
List<Trade> trades = getAllTrades();
// shut down trades in parallel
Set<Runnable> tasks = new HashSet<Runnable>();

View file

@ -85,7 +85,6 @@ public final class DepositsConfirmedMessage extends TradeMailboxMessage {
public String toString() {
return "DepositsConfirmedMessage {" +
"\n senderNodeAddress=" + senderNodeAddress +
",\n pubKeyRing=" + pubKeyRing +
",\n sellerPaymentAccountKey=" + Utilities.bytesAsHexString(sellerPaymentAccountKey) +
",\n updatedMultisigHex=" + (updatedMultisigHex == null ? null : updatedMultisigHex.substring(0, Math.max(updatedMultisigHex.length(), 1000))) +
"\n} " + super.toString();