requestTransaction method
Request a transaction from the best available peer Returns the peer handling the request, or null if no peers available
Implementation
@override
Future<PeerI?> requestTransaction(Hash txHash) async {
if (_isShutdown) {
return null;
}
final peer = _selectBestPeer();
if (peer == null) {
logger.warning('No available peers for transaction request');
return null;
}
try {
await peer.requestTransaction(txHash);
logger.fine('Requested transaction $txHash from $peer');
return peer;
} catch (e) {
logger.warning('Failed to request transaction from $peer: $e');
return null;
}
}