@Nullable public ECKey findKeyFromPubKey(byte[] pubkey){
  lock.lock();
  try {
    for (    ECKey key : keychain) {
      if (Arrays.equals(key.getPubKey(),pubkey))       return key;
    }
    return null;
  }
  finally {
    lock.unlock();
  }
}

@ Nullable public ECKey findKeyFromPubKey ( byte [ ] pubkey ) { lock . lock ( ) ; try { for ( ECKey key : keychain ) { if ( Arrays . equals ( key . getPubKey ( ) , pubkey ) ) return key ; } return null ; } finally { lock . unlock ( ) ; } }
locates a keypair from the keychain given the raw public key bytes .
