public static RevocationHash bruteForceHash(byte[] seed,byte[] target,int maxChildTries,int maxSiblingTries){
  for (int i=0; i < maxChildTries; i++) {
    for (int j=0; j < maxSiblingTries; j++) {
      RevocationHash test=HashDerivation.calculateRevocationHash(seed,0,j);
      if (Arrays.equals(test.getSecretHash(),target)) {
        return new RevocationHash(i,j,test.getSecret(),test.getSecretHash());
      }
    }
    seed=Tools.hashSecret(seed);
  }
  return null;
}

public static RevocationHash bruteForceHash ( byte [ ] seed , byte [ ] target , int maxChildTries , int maxSiblingTries ) { for ( int i = 0 ; i < maxChildTries ; i ++ ) { for ( int j = 0 ; j < maxSiblingTries ; j ++ ) { RevocationHash test = HashDerivation . calculateRevocationHash ( seed , 0 , j ) ; if ( Arrays . equals ( test . getSecretHash ( ) , target ) ) { return new RevocationHash ( i , j , test . getSecret ( ) , test . getSecretHash ( ) ) ; } } seed = Tools . hashSecret ( seed ) ; } return null ; }
the other party has breached the contract and submitted an old channel transaction .
