mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-01 21:17:13 +00:00
Wallet: make keychain private and add a remove method.
This commit is contained in:
@@ -57,7 +57,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class PingService {
|
||||
private final PeerGroup peerGroup;
|
||||
private final BlockChain chain;
|
||||
private final BlockStore blockStore;
|
||||
private final File walletFile;
|
||||
|
||||
@@ -77,7 +76,7 @@ public class PingService {
|
||||
w = Wallet.loadFromFile(walletFile);
|
||||
} catch (IOException e) {
|
||||
w = new Wallet(params);
|
||||
w.keychain.add(new ECKey());
|
||||
w.addKey(new ECKey());
|
||||
w.saveToFile(walletFile);
|
||||
}
|
||||
final Wallet wallet = w;
|
||||
@@ -95,7 +94,7 @@ public class PingService {
|
||||
CheckpointManager.checkpoint(params, stream, blockStore, key.getCreationTimeSeconds());
|
||||
}
|
||||
}
|
||||
chain = new BlockChain(params, wallet, blockStore);
|
||||
BlockChain chain = new BlockChain(params, wallet, blockStore);
|
||||
// Connect to the localhost node. One minute timeout since we won't try any other peers
|
||||
System.out.println("Connecting ...");
|
||||
peerGroup = new PeerGroup(params, chain);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class ToyWallet {
|
||||
wallet.saveToFile(walletFile);
|
||||
freshWallet = true;
|
||||
}
|
||||
System.out.println("Send to: " + wallet.keychain.get(0).toAddress(params));
|
||||
System.out.println("Send to: " + wallet.getKeys().get(0).toAddress(params));
|
||||
System.out.println(wallet);
|
||||
|
||||
wallet.autosaveToFile(walletFile, 500, TimeUnit.MILLISECONDS, null);
|
||||
@@ -238,7 +238,7 @@ public class ToyWallet {
|
||||
}
|
||||
|
||||
private void setupWindow(JFrame window) {
|
||||
final Address address = wallet.keychain.get(0).toAddress(params);
|
||||
final Address address = wallet.getKeys().get(0).toAddress(params);
|
||||
JLabel instructions = new JLabel(
|
||||
"<html>Broadcast transactions appear below. Watch them gain confidence.<br>" +
|
||||
"Send coins to: <b>" + address + "</b> <i>(click to place on clipboard)</i>");
|
||||
|
||||
Reference in New Issue
Block a user