@@ -61,7 +61,6 @@ class CValidationState;
6161
6262struct PrecomputedTransactionData ;
6363struct CBlockTemplate ;
64- struct CNodeStateStats ;
6564
6665/* * Default for -limitancestorcount, max number of in-mempool ancestors */
6766static const unsigned int DEFAULT_ANCESTOR_LIMIT = 25 ;
@@ -181,11 +180,6 @@ extern CBlockIndex* pindexBestHeader;
181180/* * Minimum disk space required - used in CheckDiskSpace() */
182181static const uint64_t nMinDiskSpace = 52428800 ;
183182
184- /* * Register with a network node to receive its signals */
185- void RegisterNodeSignals (CNodeSignals& nodeSignals);
186- /* * Unregister a network node */
187- void UnregisterNodeSignals (CNodeSignals& nodeSignals);
188-
189183/* *
190184 * Process an incoming block. This only returns after the best known valid
191185 * block is made active. Note that it does not, however, guarantee that the
@@ -216,17 +210,6 @@ bool LoadBlockIndex(std::string& strError);
216210void UnloadBlockIndex ();
217211/* * See whether the protocol update is enforced for connected nodes */
218212int ActiveProtocol ();
219- /* * Process protocol messages received from a given node */
220- bool ProcessMessages (CNode* pfrom, CConnman& connman, std::atomic<bool >& interrupt);
221- /* *
222- * Send queued protocol messages to be sent to a give node.
223- *
224- * @param[in] pto The node which we are sending messages to.
225- * @param[in] connman The connection manager for that node.
226- * @param[in] interrupt Interrupt condition for processing threads
227- * @return True if there is more work to be done
228- */
229- bool SendMessages (CNode* pto, CConnman& connman, std::atomic<bool >& interrupt);
230213/* * Run an instance of the script checking thread */
231214void ThreadScriptCheck ();
232215
@@ -250,10 +233,6 @@ CAmount GetBlockValue(int nHeight);
250233
251234/* * Create a new block index entry for a given block hash */
252235CBlockIndex* InsertBlockIndex (uint256 hash);
253- /* * Get statistics from node state */
254- bool GetNodeStateStats (NodeId nodeid, CNodeStateStats& stats);
255- /* * Increase a node's misbehavior score. */
256- void Misbehaving (NodeId nodeid, int howmuch) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
257236/* * Flush all state, indexes and buffers to disk. */
258237void FlushStateToDisk ();
259238
@@ -266,13 +245,6 @@ int GetIXConfirmations(uint256 nTXHash);
266245/* * Convert CValidationState to a human-readable message for logging */
267246std::string FormatStateMessage (const CValidationState &state);
268247
269- struct CNodeStateStats {
270- int nMisbehavior;
271- int nSyncHeight;
272- int nCommonHeight;
273- std::vector<int > vHeightInFlight;
274- };
275-
276248CAmount GetMinRelayFee (const CTransaction& tx, const CTxMemPool& pool, unsigned int nBytes, bool fAllowFree );
277249
278250/* *
@@ -452,4 +424,37 @@ static const unsigned int REJECT_ALREADY_KNOWN = 0x101;
452424/* * Transaction conflicts with a transaction already known */
453425static const unsigned int REJECT_CONFLICT = 0x102 ;
454426
427+
428+ // The following things handle network-processing logic
429+ // (and should be moved to a separate file)
430+
431+ /* * Register with a network node to receive its signals */
432+ void RegisterNodeSignals (CNodeSignals& nodeSignals);
433+ /* * Unregister a network node */
434+ void UnregisterNodeSignals (CNodeSignals& nodeSignals);
435+
436+ struct CNodeStateStats {
437+ int nMisbehavior;
438+ int nSyncHeight;
439+ int nCommonHeight;
440+ std::vector<int > vHeightInFlight;
441+ };
442+
443+ /* * Get statistics from node state */
444+ bool GetNodeStateStats (NodeId nodeid, CNodeStateStats& stats);
445+ /* * Increase a node's misbehavior score. */
446+ void Misbehaving (NodeId nodeid, int howmuch) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
447+
448+ /* * Process protocol messages received from a given node */
449+ bool ProcessMessages (CNode* pfrom, CConnman& connman, std::atomic<bool >& interrupt);
450+ /* *
451+ * Send queued protocol messages to be sent to a give node.
452+ *
453+ * @param[in] pto The node which we are sending messages to.
454+ * @param[in] connman The connection manager for that node.
455+ * @param[in] interrupt Interrupt condition for processing threads
456+ * @return True if there is more work to be done
457+ */
458+ bool SendMessages (CNode* pto, CConnman& connman, std::atomic<bool >& interrupt);
459+
455460#endif // BITCOIN_MAIN_H
0 commit comments