File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
common/src/main/java/haveno/common/persistence
core/src/main/java/haveno/core/trade Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -433,12 +433,14 @@ public void requestPersistence() {
433
433
private void maybeStartTimerForPersistence () {
434
434
// We write to disk with a delay to avoid frequent write operations. Depending on the priority those delays
435
435
// can be rather long.
436
- if (timer == null ) {
437
- timer = UserThread .runAfter (() -> {
438
- persistNow (null );
439
- UserThread .execute (() -> timer = null );
440
- }, source .delay , TimeUnit .MILLISECONDS );
441
- }
436
+ UserThread .execute (() -> {
437
+ if (timer == null ) {
438
+ timer = UserThread .runAfter (() -> {
439
+ persistNow (null );
440
+ UserThread .execute (() -> timer = null );
441
+ }, source .delay , TimeUnit .MILLISECONDS );
442
+ }
443
+ });
442
444
}
443
445
444
446
public void forcePersistNow () {
Original file line number Diff line number Diff line change @@ -1098,7 +1098,6 @@ public MoneroTxWallet createTx(MoneroTxConfig txConfig) {
1098
1098
synchronized (HavenoUtils .getWalletFunctionLock ()) {
1099
1099
MoneroTxWallet tx = wallet .createTx (txConfig );
1100
1100
exportMultisigHex ();
1101
- saveWallet ();
1102
1101
return tx ;
1103
1102
}
1104
1103
}
@@ -1107,7 +1106,7 @@ public MoneroTxWallet createTx(MoneroTxConfig txConfig) {
1107
1106
public void exportMultisigHex () {
1108
1107
synchronized (walletLock ) {
1109
1108
getSelf ().setUpdatedMultisigHex (wallet .exportMultisigHex ());
1110
- requestPersistence ();
1109
+ saveWallet ();
1111
1110
}
1112
1111
}
1113
1112
@@ -1888,7 +1887,7 @@ public void setState(State state) {
1888
1887
}
1889
1888
1890
1889
this .state = state ;
1891
- requestPersistence ( );
1890
+ persistNow ( null );
1892
1891
UserThread .execute (() -> {
1893
1892
stateProperty .set (state );
1894
1893
phaseProperty .set (state .getPhase ());
@@ -1920,7 +1919,7 @@ public void setPayoutState(PayoutState payoutState) {
1920
1919
}
1921
1920
1922
1921
this .payoutState = payoutState ;
1923
- requestPersistence ( );
1922
+ persistNow ( null );
1924
1923
UserThread .execute (() -> payoutStateProperty .set (payoutState ));
1925
1924
}
1926
1925
@@ -1936,6 +1935,7 @@ public void setDisputeState(DisputeState disputeState) {
1936
1935
}
1937
1936
1938
1937
this .disputeState = disputeState ;
1938
+ persistNow (null );
1939
1939
UserThread .execute (() -> {
1940
1940
disputeStateProperty .set (disputeState );
1941
1941
});
You can’t perform that action at this time.
0 commit comments