mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-12-12 14:43:02 -05:00
Publish arbitrator after bootstrap completed
This commit is contained in:
parent
cb1de4a9c9
commit
d99b5ade5e
1 changed files with 10 additions and 6 deletions
|
|
@ -135,23 +135,27 @@ public class ArbitratorManager {
|
||||||
if (user.getRegisteredArbitrator() != null) {
|
if (user.getRegisteredArbitrator() != null) {
|
||||||
P2PService p2PService = arbitratorService.getP2PService();
|
P2PService p2PService = arbitratorService.getP2PService();
|
||||||
if (p2PService.isBootstrapped())
|
if (p2PService.isBootstrapped())
|
||||||
republishArbitrator();
|
isBootstrapped();
|
||||||
else
|
else
|
||||||
p2PService.addP2PServiceListener(new BootstrapListener() {
|
p2PService.addP2PServiceListener(new BootstrapListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onBootstrapComplete() {
|
public void onBootstrapComplete() {
|
||||||
republishArbitrator();
|
isBootstrapped();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
republishArbitratorTimer = UserThread.runPeriodically(this::republishArbitrator, REPUBLISH_MILLIS, TimeUnit.MILLISECONDS);
|
|
||||||
|
|
||||||
UserThread.runAfter(this::republishArbitrator, REPEATED_REPUBLISH_AT_STARTUP_SEC);
|
|
||||||
|
|
||||||
applyArbitrators();
|
applyArbitrators();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void isBootstrapped() {
|
||||||
|
if (republishArbitratorTimer == null) {
|
||||||
|
republishArbitratorTimer = UserThread.runPeriodically(this::republishArbitrator, REPUBLISH_MILLIS, TimeUnit.MILLISECONDS);
|
||||||
|
UserThread.runAfter(this::republishArbitrator, REPEATED_REPUBLISH_AT_STARTUP_SEC);
|
||||||
|
republishArbitrator();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void applyArbitrators() {
|
public void applyArbitrators() {
|
||||||
Map<NodeAddress, Arbitrator> map = arbitratorService.getArbitrators();
|
Map<NodeAddress, Arbitrator> map = arbitratorService.getArbitrators();
|
||||||
log.trace("Arbitrators . size=" + map.values().size());
|
log.trace("Arbitrators . size=" + map.values().size());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue