Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove trx trace info #1918

Merged
merged 2 commits into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions src/main/java/org/tron/core/net/node/NodeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,24 @@ public void setPool(SyncPool pool) {
}

public void broadcast(Message msg) {
InventoryType type;
if (msg instanceof BlockMessage) {
logger.info("Ready to broadcast block {}", ((BlockMessage) msg).getBlockId());
freshBlockId.offer(((BlockMessage) msg).getBlockId());
BlockCache.put(msg.getMessageId(), (BlockMessage) msg);
type = InventoryType.BLOCK;
} else if (msg instanceof TransactionMessage) {
TrxCache.put(msg.getMessageId(), (TransactionMessage) msg);
type = InventoryType.TRX;
} else {
return;
}
synchronized (advObjToSpread) {
advObjToSpread.put(msg.getMessageId(), type);
try {
InventoryType type;
if (msg instanceof BlockMessage) {
logger.info("Ready to broadcast block {}", ((BlockMessage) msg).getBlockId());
freshBlockId.offer(((BlockMessage) msg).getBlockId());
BlockCache.put(msg.getMessageId(), (BlockMessage) msg);
type = InventoryType.BLOCK;
} else if (msg instanceof TransactionMessage) {
TrxCache.put(msg.getMessageId(), new TransactionMessage(msg.getData()));
type = InventoryType.TRX;
} else {
return;
}
synchronized (advObjToSpread) {
advObjToSpread.put(msg.getMessageId(), type);
}
} catch (Exception e) {
logger.error("Broadcast message failed, type: {}, reason: {}", msg.getType(), e.getMessage());
}
}

Expand Down