mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 14:54:15 +00:00
Wallet: Short-circuit runnable creation if executor is SAME_THREAD
This commit is contained in:
parent
b8a1976422
commit
8e58839d81
@ -3229,12 +3229,16 @@ public class Wallet implements Serializable, BlockChainListener, PeerFilterProvi
|
|||||||
private void queueOnTransactionConfidenceChanged(final Transaction tx) {
|
private void queueOnTransactionConfidenceChanged(final Transaction tx) {
|
||||||
checkState(lock.isHeldByCurrentThread());
|
checkState(lock.isHeldByCurrentThread());
|
||||||
for (final ListenerRegistration<WalletEventListener> registration : eventListeners) {
|
for (final ListenerRegistration<WalletEventListener> registration : eventListeners) {
|
||||||
registration.executor.execute(new Runnable() {
|
if (registration.executor == Threading.SAME_THREAD) {
|
||||||
@Override
|
registration.listener.onTransactionConfidenceChanged(this, tx);
|
||||||
public void run() {
|
} else {
|
||||||
registration.listener.onTransactionConfidenceChanged(Wallet.this, tx);
|
registration.executor.execute(new Runnable() {
|
||||||
}
|
@Override
|
||||||
});
|
public void run() {
|
||||||
|
registration.listener.onTransactionConfidenceChanged(Wallet.this, tx);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user