mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-15 11:45:51 +00:00
Context: some small fixes + javadocs for WalletAppKit
This commit is contained in:
parent
b5994e3788
commit
09744edfe3
@ -86,10 +86,16 @@ public class WalletAppKit extends AbstractIdleService {
|
|||||||
|
|
||||||
protected volatile Context context;
|
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) {
|
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) {
|
public WalletAppKit(Context context, File directory, String filePrefix) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.params = checkNotNull(context.getParams());
|
this.params = checkNotNull(context.getParams());
|
||||||
@ -454,6 +460,7 @@ public class WalletAppKit extends AbstractIdleService {
|
|||||||
protected void shutDown() throws Exception {
|
protected void shutDown() throws Exception {
|
||||||
// Runs in a separate thread.
|
// Runs in a separate thread.
|
||||||
try {
|
try {
|
||||||
|
Context.propagate(context);
|
||||||
vPeerGroup.stop();
|
vPeerGroup.stop();
|
||||||
vWallet.saveToFile(vWalletFile);
|
vWallet.saveToFile(vWalletFile);
|
||||||
vStore.close();
|
vStore.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user