mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 23:32:16 +00:00
Optimization when downloading blocks (should be rare these days), don't format log messages that requires an expensive hash->string conversion if the debug channel is not enabled.
This commit is contained in:
parent
049baad8c6
commit
2e895e4e09
@ -640,7 +640,8 @@ public class Peer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void processBlock(Block m) throws IOException {
|
private synchronized void processBlock(Block m) throws IOException {
|
||||||
log.debug("{}: Received broadcast block {}", address.get(), m.getHashAsString());
|
if (log.isDebugEnabled())
|
||||||
|
log.debug("{}: Received broadcast block {}", address.get(), m.getHashAsString());
|
||||||
try {
|
try {
|
||||||
// Was this block requested by getBlock()?
|
// Was this block requested by getBlock()?
|
||||||
if (maybeHandleRequestedData(m)) return;
|
if (maybeHandleRequestedData(m)) return;
|
||||||
@ -691,7 +692,8 @@ public class Peer {
|
|||||||
|
|
||||||
// TODO: Fix this duplication.
|
// TODO: Fix this duplication.
|
||||||
private synchronized void processFilteredBlock(FilteredBlock m) throws IOException {
|
private synchronized void processFilteredBlock(FilteredBlock m) throws IOException {
|
||||||
log.debug("{}: Received broadcast filtered block {}", address.get(), m.getHash().toString());
|
if (log.isDebugEnabled())
|
||||||
|
log.debug("{}: Received broadcast filtered block {}", address.get(), m.getHash().toString());
|
||||||
try {
|
try {
|
||||||
if (!downloadData.get()) {
|
if (!downloadData.get()) {
|
||||||
log.debug("{}: Received block we did not ask for: {}", address.get(), m.getHash().toString());
|
log.debug("{}: Received block we did not ask for: {}", address.get(), m.getHash().toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user