bitcoinj/bitcoinj — pull request #90 by haraldh (2014-06-04 15:14:51+00:00)
Title: DeterministicKeyChain: call maybeLookahead(), if lookahead or threshold changes

The immediate key creation would allow UIs to precreate the lookahead keys
in a separate thread and report the progress to the UI.

E.g. Android AsyncTask:

wallet.setLookaheadThreshold(0);

for (int l = 1; l <= lookahead; l++) {
wallet.setKeychainLookaheadSize(lookahead);
publishProgress(l * 100 / lookahead);
}