mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 06:47:54 +01:00
Wallet: take key chain lock not only wallet lock in getWatchedOutputs().
Flagged by the IntelliJ Inspector static analysis engine.
This commit is contained in:
parent
b7c24c6196
commit
d753d28ba5
1 changed files with 2 additions and 0 deletions
|
@ -2600,6 +2600,7 @@ public class Wallet extends BaseTaggableObject implements BlockChainListener, Pe
|
|||
*/
|
||||
public List<TransactionOutput> getWatchedOutputs(boolean excludeImmatureCoinbases) {
|
||||
lock.lock();
|
||||
keychainLock.lock();
|
||||
try {
|
||||
LinkedList<TransactionOutput> candidates = Lists.newLinkedList();
|
||||
for (Transaction tx : Iterables.concat(unspent.values(), pending.values())) {
|
||||
|
@ -2617,6 +2618,7 @@ public class Wallet extends BaseTaggableObject implements BlockChainListener, Pe
|
|||
}
|
||||
return candidates;
|
||||
} finally {
|
||||
keychainLock.unlock();
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue