3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 15:22:16 +00:00

WalletTest: pin creation time of wallet key hierarchy in keyRotationHD test to avoid timing race. Should resolve issue 575.

This commit is contained in:
Mike Hearn 2014-08-23 13:11:05 +02:00
parent df006ba2ba
commit 729c716b18

View File

@ -2352,6 +2352,7 @@ public class WalletTest extends TestWithWallet {
public void keyRotationHD() throws Exception { public void keyRotationHD() throws Exception {
// Test that if we rotate an HD chain, a new one is created and all arrivals on the old keys are moved. // Test that if we rotate an HD chain, a new one is created and all arrivals on the old keys are moved.
Utils.setMockClock(); Utils.setMockClock();
wallet = new Wallet(params);
ECKey key1 = wallet.freshReceiveKey(); ECKey key1 = wallet.freshReceiveKey();
ECKey key2 = wallet.freshReceiveKey(); ECKey key2 = wallet.freshReceiveKey();
sendMoneyToWallet(wallet, CENT, key1.toAddress(params), AbstractBlockChain.NewBlockType.BEST_CHAIN); sendMoneyToWallet(wallet, CENT, key1.toAddress(params), AbstractBlockChain.NewBlockType.BEST_CHAIN);