mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-25 07:07:39 +01:00
Couple of minor concurrency fixes.
This commit is contained in:
parent
de6d27aef8
commit
edb3814b56
1 changed files with 2 additions and 2 deletions
|
@ -306,7 +306,7 @@ public class PeerGroup {
|
||||||
* <li>Announcing pending transactions that didn't get into the chain yet to our peers.</li>
|
* <li>Announcing pending transactions that didn't get into the chain yet to our peers.</li>
|
||||||
* </ol>
|
* </ol>
|
||||||
*/
|
*/
|
||||||
public void addWallet(Wallet wallet) {
|
public synchronized void addWallet(Wallet wallet) {
|
||||||
if (wallet == null)
|
if (wallet == null)
|
||||||
throw new IllegalArgumentException("wallet is null");
|
throw new IllegalArgumentException("wallet is null");
|
||||||
wallets.add(wallet);
|
wallets.add(wallet);
|
||||||
|
@ -527,8 +527,8 @@ public class PeerGroup {
|
||||||
// Now tell the peers about any transactions we have which didn't appear in the chain yet. These are not
|
// Now tell the peers about any transactions we have which didn't appear in the chain yet. These are not
|
||||||
// necessarily spends we created. They may also be transactions broadcast across the network that we saw,
|
// necessarily spends we created. They may also be transactions broadcast across the network that we saw,
|
||||||
// which are relevant to us, and which we therefore wish to help propagate (ie they send us coins).
|
// which are relevant to us, and which we therefore wish to help propagate (ie they send us coins).
|
||||||
announcePendingWalletTransactions(wallets, Collections.singleton(peer));
|
|
||||||
peer.addEventListener(getDataListener);
|
peer.addEventListener(getDataListener);
|
||||||
|
announcePendingWalletTransactions(wallets, Collections.singleton(peer));
|
||||||
synchronized (peerEventListeners) {
|
synchronized (peerEventListeners) {
|
||||||
for (PeerEventListener listener : peerEventListeners) {
|
for (PeerEventListener listener : peerEventListeners) {
|
||||||
synchronized (listener) {
|
synchronized (listener) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue