question: private void cleanPool ( ) { lock . lock ( ) ; try { Reference < ? extends Transaction > ref ; while ( ( ref = referenceQueue . poll ( ) ) != null ) { WeakTransactionReference txRef = ( WeakTransactionReference ) ref ; memoryPool . remove ( txRef . hash ) ; } } finally { lock . unlock ( ) ; } }
target:  If any transactions have expired due to being only weakly reachable through us, go ahead and delete their memoryPool entries - it means we downloaded the transaction and sent it to various event listeners, none of which bothered to keep a reference. Typically, this is because the transaction does not involve any keys that are relevant to any of our wallets.