mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 06:44:16 +00:00
TransactionBroadcast: Better logging
This commit is contained in:
parent
71e9a2d4b2
commit
b9cf28d358
@ -83,7 +83,7 @@ public class TransactionBroadcast {
|
|||||||
|
|
||||||
public ListenableFuture<Transaction> broadcast() {
|
public ListenableFuture<Transaction> broadcast() {
|
||||||
peerGroup.addEventListener(rejectionListener, Threading.SAME_THREAD);
|
peerGroup.addEventListener(rejectionListener, Threading.SAME_THREAD);
|
||||||
log.info("Waiting for {} peers required for broadcast ...", minConnections);
|
log.info("Waiting for {} peers required for broadcast, we have {} ...", minConnections, peerGroup.getConnectedPeers().size());
|
||||||
peerGroup.waitForPeers(minConnections).addListener(new EnoughAvailablePeers(), Threading.SAME_THREAD);
|
peerGroup.waitForPeers(minConnections).addListener(new EnoughAvailablePeers(), Threading.SAME_THREAD);
|
||||||
return future;
|
return future;
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ public class TransactionBroadcast {
|
|||||||
numWaitingFor = (int) Math.ceil((peers.size() - numToBroadcastTo) / 2.0);
|
numWaitingFor = (int) Math.ceil((peers.size() - numToBroadcastTo) / 2.0);
|
||||||
Collections.shuffle(peers, random);
|
Collections.shuffle(peers, random);
|
||||||
peers = peers.subList(0, numToBroadcastTo);
|
peers = peers.subList(0, numToBroadcastTo);
|
||||||
log.info("broadcastTransaction: We have {} peers, adding {} to the memory pool and sending to {} peers, will wait for {}: {}",
|
log.info("broadcastTransaction: We have {} peers, adding {} to the memory pool and sending to {} peers, will wait for {}, sending to: {}",
|
||||||
numConnected, tx.getHashAsString(), numToBroadcastTo, numWaitingFor, Joiner.on(",").join(peers));
|
numConnected, tx.getHashAsString(), numToBroadcastTo, numWaitingFor, Joiner.on(",").join(peers));
|
||||||
for (Peer peer : peers) {
|
for (Peer peer : peers) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user