docs: public Coin getValueSentFromMe(TransactionBag wallet) throws ScriptException {
          // This is tested in WalletTest.
          Coin v = Coin.ZERO;
          for (TransactionInput input : inputs) {
              // This input is taking value from a transaction in our wallet. To discover the value,
              // we must find the connected transaction.
              TransactionOutput connected = input.getConnectedOutput(wallet.getTransactionPool(Pool.UNSPENT));
              if (connected == null)
                  connected = input.getConnectedOutput(wallet.getTransactionPool(Pool.SPENT));
              if (connected == null)
                  connected = input.getConnectedOutput(wallet.getTransactionPool(Pool.PENDING));
              if (connected == null)
                  continue;
              // The connected output may be the change to the sender of a previous input sent to this wallet. In this
              // case we ignore it.
              if (!connected.isMineOrWatched(wallet))
                  continue;
              v = v.add(connected.getValue());
          }
          return v;
      }