3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 10:45:51 +00:00

Context: some small fixes + javadocs for WalletAppKit

This commit is contained in:
Mike Hearn 2015-04-06 17:20:03 +02:00
parent b5994e3788
commit 09744edfe3

View File

@ -86,10 +86,16 @@ public class WalletAppKit extends AbstractIdleService {
protected volatile Context context;
/**
* Creates a new WalletAppKit, with a newly created {@link Context}. Files will be stored in the given directory.
*/
public WalletAppKit(NetworkParameters params, File directory, String filePrefix) {
this(Context.getOrCreate(params), directory, filePrefix);
this(new Context(params), directory, filePrefix);
}
/**
* Creates a new WalletAppKit, with the given {@link Context}. Files will be stored in the given directory.
*/
public WalletAppKit(Context context, File directory, String filePrefix) {
this.context = context;
this.params = checkNotNull(context.getParams());
@ -454,6 +460,7 @@ public class WalletAppKit extends AbstractIdleService {
protected void shutDown() throws Exception {
// Runs in a separate thread.
try {
Context.propagate(context);
vPeerGroup.stop();
vWallet.saveToFile(vWalletFile);
vStore.close();