void HandleSyncQueryResponse(NetworkPacket packet) { TransactionSyncQueryResponse tsqr = new TransactionSyncQueryResponse(); tsqr.Deserialize(packet.Data); // Well, we have received a response from a node. // CRITICAL: Test if we ordered it. Then check if we are behind, if so, send fetch requests. // if(nodeState.NodeInfo) }
void HandleSyncQueryRequest(NetworkPacket packet) { TransactionSyncQueryResponse transactionSyncQueryResponse = new TransactionSyncQueryResponse(); transactionSyncQueryResponse.LedgerSequence = nodeState.NodeInfo.LastLedgerInfo.SequenceNumber; NetworkPacket np = new NetworkPacket(new Hash(nodeState.NodeInfo.PublicKey), PacketType.TPT_TX_SYNC_QUERY_RESPONSE, transactionSyncQueryResponse.Serialize(), packet.Token); network.AddToQueue(new NetworkPacketQueueEntry(packet.PublicKeySource, np)); // Send the reply. }