Make the grapheneapi multi account compatible
This commit is contained in:
parent
c2d13087e9
commit
84cc13b5f6
1 changed files with 11 additions and 3 deletions
|
@ -413,10 +413,18 @@ public abstract class GrapheneApiGenerator {
|
||||||
currentBitsharesListener.put(accountId,balanceListener);
|
currentBitsharesListener.put(accountId,balanceListener);
|
||||||
bitsharesSubscriptionHub.addSubscriptionListener(balanceListener);
|
bitsharesSubscriptionHub.addSubscriptionListener(balanceListener);
|
||||||
|
|
||||||
if(!subscriptionThread.isConnected()){
|
if(!subscriptionThread.isConnected() && !subscriptionThread.isAlive()){
|
||||||
subscriptionThread.start();
|
try {
|
||||||
|
subscriptionThread.start();
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}else if(!bitsharesSubscriptionHub.isSubscribed()){
|
}else if(!bitsharesSubscriptionHub.isSubscribed()){
|
||||||
bitsharesSubscriptionHub.resubscribe();
|
try {
|
||||||
|
bitsharesSubscriptionHub.resubscribe();
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue