From 09744edfe305a9c1adcefda48c76cbb100cac497 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Mon, 6 Apr 2015 17:20:03 +0200 Subject: [PATCH] Context: some small fixes + javadocs for WalletAppKit --- core/src/main/java/org/bitcoinj/kits/WalletAppKit.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java b/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java index 2fc47601..167275ca 100644 --- a/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java +++ b/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java @@ -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();