mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 14:07:14 +00:00
Propagate context to the wallet autosave thread.
This commit is contained in:
@@ -1404,6 +1404,11 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
|
|||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the API context that this wallet was created with. */
|
||||||
|
public Context getContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Returns a wallet deserialized from the given file. Extensions previously saved with the wallet can be
|
* <p>Returns a wallet deserialized from the given file. Extensions previously saved with the wallet can be
|
||||||
* deserialized by calling @{@link WalletExtension#deserializeWalletExtension(Wallet, byte[])}}</p>
|
* deserialized by calling @{@link WalletExtension#deserializeWalletExtension(Wallet, byte[])}}</p>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
package org.bitcoinj.wallet;
|
package org.bitcoinj.wallet;
|
||||||
|
|
||||||
import org.bitcoinj.core.Wallet;
|
import org.bitcoinj.core.*;
|
||||||
import org.bitcoinj.utils.Threading;
|
import org.bitcoinj.utils.Threading;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -88,6 +88,7 @@ public class WalletFiles {
|
|||||||
|
|
||||||
this.saver = new Callable<Void>() {
|
this.saver = new Callable<Void>() {
|
||||||
@Override public Void call() throws Exception {
|
@Override public Void call() throws Exception {
|
||||||
|
Context.propagate(wallet.getContext());
|
||||||
// Runs in an auto save thread.
|
// Runs in an auto save thread.
|
||||||
if (!savePending.getAndSet(false)) {
|
if (!savePending.getAndSet(false)) {
|
||||||
// Some other scheduled request already beat us to it.
|
// Some other scheduled request already beat us to it.
|
||||||
|
|||||||
Reference in New Issue
Block a user