getPriority static method
Determine priority based on message command
Implementation
static MessagePriority getPriority(String command) {
switch (command) {
// Critical - protocol handshake and keepalive
case 'version':
case 'verack':
case 'pong':
return MessagePriority.critical;
// High - blocks and important announcements
case 'headers':
case 'getheaders':
case 'block':
case 'inv': // Could be block announcements
return MessagePriority.high;
// Normal - transactions and peer discovery
case 'tx':
case 'getdata':
case 'addr':
case 'ping':
return MessagePriority.normal;
// Low - background operations
case 'mempool':
case 'reject':
return MessagePriority.low;
default:
return MessagePriority.normal;
}
}