code: public void addWallet(Wallet wallet) {
          lock.lock();
          try {
              checkNotNull(wallet);
              checkState(!wallets.contains(wallet));
              wallets.add(wallet);
              wallet.setTransactionBroadcaster(this);
              wallet.addCoinsReceivedEventListener(Threading.SAME_THREAD, walletCoinsReceivedEventListener);
              wallet.addKeyChainEventListener(Threading.SAME_THREAD, walletKeyEventListener);
              wallet.addScriptsChangeEventListener(Threading.SAME_THREAD, walletScriptsEventListener);
              addPeerFilterProvider(wallet);
              for (Peer peer : peers) {
                  peer.addWallet(wallet);
              }
          } finally {
              lock.unlock();
          }
      }
docs: <p>Link the given wallet to this PeerGroup. This is used for three purposes:</p>
  
  <ol>
  <li>So the wallet receives broadcast transactions.</li>
  <li>Announcing pending transactions that didn't get into the chain yet to our peers.</li>
  <li>Set the fast catchup time using {@link PeerGroup#setFastCatchupTimeSecs(long)}, to optimize chain
  download.</li>
  </ol>
  
  <p>Note that this should be done before chain download commences because if you add a wallet with keys earlier
  than the current chain head, the relevant parts of the chain won't be redownloaded for you.</p>
  
  <p>The Wallet will have an event listener registered on it, so to avoid leaks remember to use
  {@link PeerGroup#removeWallet(Wallet)} on it if you wish to keep the Wallet but lose the PeerGroup.</p>