mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 13:22:42 +01:00
ForwardingSevice: add an address parameter to forwardCoins()
This makes forwardCoins() a little more generically-useful and simplifies the coming conversion to CompletableFuture.
This commit is contained in:
parent
a06134cc18
commit
ccba23bd29
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user