ForwardingSevice: add an address parameter to forwardCoins()
This makes forwardCoins() a little more generically-useful and
simplifies the coming conversion to CompletableFuture.
@@ -133,7 +133,7 @@ public class ForwardingService {
tx.getConfidence().getDepthFuture(requiredConfirmations).whenComplete((result, t) -> {
if (result != null) {
System.out.println("Confirmation received.");
- forwardCoins();
+ forwardCoins(forwardingAddress);
} else {
// This kind of future can't fail, just rethrow in case something weird happens.
throw new RuntimeException(t);
@@ -154,7 +154,7 @@ public class ForwardingService {
return String.format("forwarding-service-%s", network.toString());
}
- private void forwardCoins() {
+ private void forwardCoins(Address forwardingAddress) {
try {
// Now send the coins onwards.
SendRequest sendRequest = SendRequest.emptyWallet(forwardingAddress);
