Skip to content

Commit 1a911fd

Browse files
committed
delete trade wallets after 720 confirmations
1 parent 6a22f9c commit 1a911fd

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ monerod1-local:
7070
--log-level 0 \
7171
--add-exclusive-node 127.0.0.1:48080 \
7272
--add-exclusive-node 127.0.0.1:58080 \
73-
--max-connections-per-ip 10 \
7473
--rpc-access-control-origins http://localhost:8080 \
7574
--fixed-difficulty 500 \
7675
--disable-rpc-ban \
77-
--rpc-max-connections-per-private-ip 100 \
76+
--rpc-max-connections 1000 \
77+
--max-connections-per-ip 10 \
78+
--rpc-max-connections-per-private-ip 1000 \
7879

7980
monerod2-local:
8081
./.localnet/monerod \
@@ -90,11 +91,12 @@ monerod2-local:
9091
--confirm-external-bind \
9192
--add-exclusive-node 127.0.0.1:28080 \
9293
--add-exclusive-node 127.0.0.1:58080 \
93-
--max-connections-per-ip 10 \
9494
--rpc-access-control-origins http://localhost:8080 \
9595
--fixed-difficulty 500 \
9696
--disable-rpc-ban \
97-
--rpc-max-connections-per-private-ip 100 \
97+
--rpc-max-connections 1000 \
98+
--max-connections-per-ip 10 \
99+
--rpc-max-connections-per-private-ip 1000 \
98100

99101
monerod3-local:
100102
./.localnet/monerod \
@@ -110,11 +112,12 @@ monerod3-local:
110112
--confirm-external-bind \
111113
--add-exclusive-node 127.0.0.1:28080 \
112114
--add-exclusive-node 127.0.0.1:48080 \
113-
--max-connections-per-ip 10 \
114115
--rpc-access-control-origins http://localhost:8080 \
115116
--fixed-difficulty 500 \
116117
--disable-rpc-ban \
117-
--rpc-max-connections-per-private-ip 100 \
118+
--rpc-max-connections 1000 \
119+
--max-connections-per-ip 10 \
120+
--rpc-max-connections-per-private-ip 1000 \
118121

119122
#--proxy 127.0.0.1:49775 \
120123
@@ -440,7 +443,9 @@ monerod:
440443
./.localnet/monerod \
441444
--bootstrap-daemon-address auto \
442445
--rpc-access-control-origins http://localhost:8080 \
443-
--rpc-max-connections-per-private-ip 100 \
446+
--rpc-max-connections 1000 \
447+
--max-connections-per-ip 10 \
448+
--rpc-max-connections-per-private-ip 1000 \
444449

445450
seednode:
446451
./haveno-seednode$(APP_EXT) \

core/src/main/java/haveno/core/trade/Trade.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import haveno.common.ThreadUtils;
4141
import haveno.common.Timer;
4242
import haveno.common.UserThread;
43+
import haveno.common.config.Config;
4344
import haveno.common.crypto.Encryption;
4445
import haveno.common.crypto.PubKeyRing;
4546
import haveno.common.proto.ProtoUtil;
@@ -154,7 +155,7 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
154155
private static final long DELETE_AFTER_MS = TradeProtocol.TRADE_STEP_TIMEOUT_SECONDS;
155156
private static final int NUM_CONFIRMATIONS_FOR_SCHEDULED_IMPORT = 5;
156157
public static final int NUM_BLOCKS_DEPOSITS_FINALIZED = 30; // ~1 hour before deposits are considered finalized
157-
public static final int NUM_BLOCKS_PAYOUT_FINALIZED = 60; // ~2 hours before payout is considered finalized and multisig wallet deleted
158+
public static final int NUM_BLOCKS_PAYOUT_FINALIZED = Config.baseCurrencyNetwork().isTestnet() ? 60 : 720; // ~1 day before payout is considered finalized and multisig wallet deleted
158159
protected final Object pollLock = new Object();
159160
private final Object removeTradeOnErrorLock = new Object();
160161
protected static final Object importMultisigLock = new Object();
@@ -957,6 +958,7 @@ public boolean isWalletConnectedToDaemon() {
957958
}
958959

959960
public boolean isIdling() {
961+
if (isPayoutUnlocked() && !Config.baseCurrencyNetwork().isTestnet()) return true; // idle after payout unlocked (unless testnet)
960962
return this instanceof ArbitratorTrade && isDepositsConfirmed() && walletExists() && pollNormalStartTimeMs == null; // arbitrator idles trade after deposits confirm unless overriden
961963
}
962964

0 commit comments

Comments
 (0)