mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-11-17 00:07:49 +00:00
run arbitrator protocol on trade thread
This commit is contained in:
parent
11c8b05f45
commit
ea4359d164
1 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
package haveno.core.trade.protocol;
|
||||
|
||||
import haveno.common.ThreadUtils;
|
||||
import haveno.common.handlers.ErrorMessageHandler;
|
||||
import haveno.core.trade.ArbitratorTrade;
|
||||
import haveno.core.trade.Trade;
|
||||
|
@ -43,7 +44,7 @@ public class ArbitratorProtocol extends DisputeProtocol {
|
|||
|
||||
public void handleInitTradeRequest(InitTradeRequest message, NodeAddress peer, ErrorMessageHandler errorMessageHandler) {
|
||||
System.out.println("ArbitratorProtocol.handleInitTradeRequest()");
|
||||
new Thread(() -> {
|
||||
ThreadUtils.execute(() -> {
|
||||
synchronized (trade) {
|
||||
latchTrade();
|
||||
this.errorMessageHandler = errorMessageHandler;
|
||||
|
@ -68,7 +69,7 @@ public class ArbitratorProtocol extends DisputeProtocol {
|
|||
.executeTasks(true);
|
||||
awaitTradeLatch();
|
||||
}
|
||||
}).start();
|
||||
}, trade.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,7 +79,7 @@ public class ArbitratorProtocol extends DisputeProtocol {
|
|||
|
||||
public void handleDepositRequest(DepositRequest request, NodeAddress sender) {
|
||||
System.out.println("ArbitratorProtocol.handleDepositRequest() " + trade.getId());
|
||||
new Thread(() -> {
|
||||
ThreadUtils.execute(() -> {
|
||||
synchronized (trade) {
|
||||
latchTrade();
|
||||
Validator.checkTradeId(processModel.getOfferId(), request);
|
||||
|
@ -103,7 +104,7 @@ public class ArbitratorProtocol extends DisputeProtocol {
|
|||
.executeTasks(true);
|
||||
awaitTradeLatch();
|
||||
}
|
||||
}).start();
|
||||
}, trade.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue