Browse Source

In Controller.processIncomingTransactionsQueue(), don't bother with 2nd-phase of locking blockchain and importing if there are no valid signature transactions to actually import

pull/73/head
catbref 3 years ago
parent
commit
a9371f0a90
  1. 7
      src/main/java/org/qortal/controller/Controller.java

7
src/main/java/org/qortal/controller/Controller.java

@ -847,7 +847,7 @@ public class Controller extends Thread {
private void processIncomingTransactionsQueue() { private void processIncomingTransactionsQueue() {
if (this.incomingTransactions.isEmpty()) { if (this.incomingTransactions.isEmpty()) {
// Don't bother locking if there are no new transactions to process // Nothing to do?
return; return;
} }
@ -912,6 +912,11 @@ public class Controller extends Thread {
sigValidTransactions.add(transaction); sigValidTransactions.add(transaction);
} }
if (sigValidTransactions.isEmpty()) {
// Don't bother locking if there are no new transactions to process
return;
}
try { try {
ReentrantLock blockchainLock = Controller.getInstance().getBlockchainLock(); ReentrantLock blockchainLock = Controller.getInstance().getBlockchainLock();
if (!blockchainLock.tryLock(2, TimeUnit.SECONDS)) { if (!blockchainLock.tryLock(2, TimeUnit.SECONDS)) {

Loading…
Cancel
Save