add check for rpc packet fix #963 (#969)

This commit is contained in:
BlackLuny
2025-06-09 19:35:29 +08:00
committed by GitHub
parent f39fbb2ce2
commit ecebbecd3b

View File

@@ -131,11 +131,14 @@ impl BidirectRpcManager {
}
};
if o.peer_manager_header().unwrap().packet_type == PacketType::RpcReq as u8 {
let Some(peer_manager_header) = o.peer_manager_header() else {
tracing::error!("peer manager header not found");
continue;
};
if peer_manager_header.packet_type == PacketType::RpcReq as u8 {
server_tx.send(o).await.unwrap();
continue;
} else if o.peer_manager_header().unwrap().packet_type == PacketType::RpcResp as u8
{
} else if peer_manager_header.packet_type == PacketType::RpcResp as u8 {
client_tx.send(o).await.unwrap();
continue;
}