Skip to content

Commit

Permalink
Merge pull request #25 from haraldh/fastcatchup
Browse files Browse the repository at this point in the history
Remove workaround for fast catchup
  • Loading branch information
ksedgwic committed Jul 31, 2014
2 parents 1c3eadf + 9d1ad72 commit 45ef26b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
25 changes: 0 additions & 25 deletions src/com/bonsai/wallet32/HDWallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ public enum HDStructVersion {
HDSV_STDV0, // Standard, version 0. M/0/0'/<acct>'/<chnge>/<n>
HDSV_STDV1 // BIP-0044. M/44'/0'/<acct>'/<chnge>/<n>
}

private ECKey mWorkaroundKey = null;

private HDStructVersion mHDStructVersion;

Expand Down Expand Up @@ -210,16 +208,6 @@ public HDWallet(WalletApplication walletApp,
mAesKey = aesKey;

try {
// See WORKAROUND below.
if (!walletNode.has("workaroundPrivKey")) {
mWorkaroundKey = new ECKey();
mWorkaroundKey.setCreationTimeSeconds(HDAddress.EPOCH);
} else {
byte[] privKeyBytes =
Base58.decode(walletNode.getString("workaroundPrivKey"));
mWorkaroundKey = new ECKey(privKeyBytes, null);
}

mWalletSeed = Base58.decode(walletNode.getString("seed"));

mPassphrase = walletNode.has("passphrase") ?
Expand Down Expand Up @@ -329,9 +317,6 @@ public JSONObject dumps(boolean isPairing) {
try {
JSONObject obj = new JSONObject();

obj.put("workaroundPrivKey",
Base58.encode(mWorkaroundKey.getPrivKeyBytes()));

obj.put("seed", Base58.encode(mWalletSeed));

obj.put("passphrase", mPassphrase);
Expand Down Expand Up @@ -391,15 +376,6 @@ public HDWallet(WalletApplication walletApp,
mPassphrase = passphrase;
mBIP39Version = bip39Version;
mHDStructVersion = hdsv;


// WORKAROUND - there is a bug that watch-only addresses
// don't seem to properly scan historically; they use
// quick catchup. Create a real key (that we ignore) as a
// workaround.
//
mWorkaroundKey = new ECKey();
mWorkaroundKey.setCreationTimeSeconds(HDAddress.EPOCH);

switch (mBIP39Version) {
case V0_5:
Expand Down Expand Up @@ -516,7 +492,6 @@ public void addAccount() {
}

public void gatherAllKeys(long creationTime, List<ECKey> keys) {
keys.add(mWorkaroundKey.encrypt(mKeyCrypter, mAesKey));
for (HDAccount acct : mAccounts)
acct.gatherAllKeys(mKeyCrypter, mAesKey, creationTime, keys);
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/bonsai/wallet32/WalletService.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ protected void onSetupCompleted() {
mLogger.info(String.format("adding %d keys",
keys.size()));
wallet().addKeys(keys);

peerGroup().setFastCatchupTimeSecs(scanTime);
// Do we have enough margin on all our chains?
// Add keys to chains which don't have enough
// unused addresses at the end.
Expand Down

0 comments on commit 45ef26b

Please sign in to comment.