mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 05:12:30 +01:00
ForwardingService: print exception in coinForwardingListener
The listener was swallowing some exceptions. This change will print those exceptions to the console.
This commit is contained in:
parent
50c0f2eae9
commit
8cff8e0ac2
@ -154,11 +154,15 @@ public class ForwardingService implements Closeable {
|
||||
System.out.printf("Transaction %s is signed and is being delivered to %s...\n", broadcast.transaction().getTxId(), network);
|
||||
return broadcast.awaitRelayed(); // Wait until peers report they have seen the transaction
|
||||
})
|
||||
.thenAccept(broadcast ->
|
||||
System.out.printf("Sent %s onwards and acknowledged by peers, via transaction %s\n",
|
||||
broadcast.transaction().getOutputSum().toFriendlyString(),
|
||||
broadcast.transaction().getTxId())
|
||||
);
|
||||
.whenComplete((broadcast, throwable) -> {
|
||||
if (broadcast != null) {
|
||||
System.out.printf("Sent %s onwards and acknowledged by peers, via transaction %s\n",
|
||||
broadcast.transaction().getOutputSum().toFriendlyString(),
|
||||
broadcast.transaction().getTxId());
|
||||
} else {
|
||||
System.out.println("Exception occurred: " + throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static String getPrefix(BitcoinNetwork network) {
|
||||
|
Loading…
Reference in New Issue
Block a user