code: public boolean isWatched(TransactionBag transactionBag) {
          try {
              Script script = getScriptPubKey();
              return transactionBag.isWatchedScript(script);
          } catch (ScriptException e) {
              // Just means we didn't understand the output of this transaction: ignore it.
              log.debug("Could not parse tx output script: {}", e.toString());
              return false;
          }
      }
docs: Returns true if this output is to a key, or an address we have the keys for, in the wallet.