@ -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 ) ) {