Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Propagate contexts in a couple of places
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehearn committed Apr 23, 2015
1 parent 70f6629 commit 3127c55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/src/main/java/lighthouse/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ public static void restart() {
}

public static void restartBitcoinJ(DeterministicSeed seed) {
Context ctx = Context.get();
new Thread(() -> {
Context.propagate(ctx);
Main.bitcoin.stopAsync();
Main.bitcoin.awaitTerminated();
uncheck(() -> Main.instance.initBitcoin(seed));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import lighthouse.protocol.*;
import lighthouse.utils.*;
import lighthouse.wallet.*;
import org.bitcoinj.core.*;
import org.slf4j.*;

import java.io.*;
Expand Down Expand Up @@ -43,10 +44,12 @@ public static void open(Project project, PledgingWallet.PendingPledge pledge, Ru
}

private void startUpload(Project project, PledgingWallet.PendingPledge pledge) {
Context ctx = Context.get();
uploadTask = new Task<Void>() {
@Override
protected Void call() throws Exception {
try {
Context.propagate(ctx);
URI url = project.getPaymentURL();
checkState(url != null);
log.info("Uploading pledge to {}", url);
Expand Down

0 comments on commit 3127c55

Please sign in to comment.