clean_up_propagation
Key
// for incoming connections we use their peer id to assertain uniquenesss
// for outgoing connections, we use the tcp endpoint address, so as not more than 1 connection is done
IsAddressConnected
Connection_Add
UniqueConnections
Connection_Delete
Connection_Print
Best_Peer_Height
Peer_Count
Random_Connection
Peer_Direction_Count
Broadcast_Block
选择合适的数据结构,往数据结构里填数据,与连接池里的 IP 挨个建立连接,然后发送数据
// broad cast a block to all connected peers
// we can only broadcast a block which is in our db
// this function is trigger from 2 points, one when we receive a unknown block which can be successfully added to chain
// second from the blockchain which has to relay locally mined blocks as soon as possible
Broadcast_Tx
选择合适的数据结构,往数据结构里填数据,与连接池里的 IP 挨个建立连接,然后发送数据
// broadcast a new transaction, return to how many peers the transaction has been broadcasted
// this function is trigger from 2 points, one when we receive a unknown tx
// second from the mempool which may want to relay local ot soon going to expire transactions
IsConnectionSyncing
trigger_sync
IsSyncing
syncroniser