mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-20 07:46:05 -04:00
Publish arbitrator after bootstrap completed
This commit is contained in:
parent
cb1de4a9c9
commit
d99b5ade5e
@ -135,23 +135,27 @@ public class ArbitratorManager {
|
||||
if (user.getRegisteredArbitrator() != null) {
|
||||
P2PService p2PService = arbitratorService.getP2PService();
|
||||
if (p2PService.isBootstrapped())
|
||||
republishArbitrator();
|
||||
isBootstrapped();
|
||||
else
|
||||
p2PService.addP2PServiceListener(new BootstrapListener() {
|
||||
@Override
|
||||
public void onBootstrapComplete() {
|
||||
republishArbitrator();
|
||||
isBootstrapped();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
republishArbitratorTimer = UserThread.runPeriodically(this::republishArbitrator, REPUBLISH_MILLIS, TimeUnit.MILLISECONDS);
|
||||
|
||||
UserThread.runAfter(this::republishArbitrator, REPEATED_REPUBLISH_AT_STARTUP_SEC);
|
||||
|
||||
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() {
|
||||
Map<NodeAddress, Arbitrator> map = arbitratorService.getArbitrators();
|
||||
log.trace("Arbitrators . size=" + map.values().size());
|
||||
|
Loading…
x
Reference in New Issue
Block a user