Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 924 Lines • ▼ Show 20 Lines | private: | ||||
void ProcessGetCFCheckPt(CNode &peer, CDataStream &vRecv, | void ProcessGetCFCheckPt(CNode &peer, CDataStream &vRecv, | ||||
const CChainParams &chain_params, | const CChainParams &chain_params, | ||||
CConnman &connman); | CConnman &connman); | ||||
/** | /** | ||||
* Decide a response for an Avalanche poll about the given block. | * Decide a response for an Avalanche poll about the given block. | ||||
* | * | ||||
* @param[in] hash The hash of the block being polled for | * @param[in] hash The hash of the block being polled for | ||||
* @param[out] uint32_t Our current vote for the block | * @return Our current vote for the block | ||||
*/ | */ | ||||
uint32_t GetAvalancheVoteForBlock(const BlockHash &hash) | uint32_t GetAvalancheVoteForBlock(const BlockHash &hash) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
/** | /** | ||||
* Checks if address relay is permitted with peer. If needed, initializes | * Checks if address relay is permitted with peer. If needed, initializes | ||||
* the m_addr_known bloom filter and sets m_addr_relay_enabled to true. | * the m_addr_known bloom filter and sets m_addr_relay_enabled to true. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 2,117 Lines • ▼ Show 20 Lines | if (!m_chainman.ProcessNewBlockHeaders(config, headers, state, | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Reconsider orphan transactions after a parent has been accepted to the | * Reconsider orphan transactions after a parent has been accepted to the | ||||
* mempool. | * mempool. | ||||
* | * | ||||
* @param[in/out] orphan_work_set The set of orphan transactions to | * @param[in,out] orphan_work_set The set of orphan transactions to | ||||
* reconsider. Generally only one orphan will be reconsidered on each call of | * reconsider. Generally only one orphan will be reconsidered on each call of | ||||
* this function. This set may be added to if accepting an orphan causes its | * this function. This set may be added to if accepting an orphan causes its | ||||
* children to be reconsidered. | * children to be reconsidered. | ||||
*/ | */ | ||||
void PeerManagerImpl::ProcessOrphanTx(const Config &config, | void PeerManagerImpl::ProcessOrphanTx(const Config &config, | ||||
std::set<TxId> &orphan_work_set) { | std::set<TxId> &orphan_work_set) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
AssertLockHeld(g_cs_orphans); | AssertLockHeld(g_cs_orphans); | ||||
▲ Show 20 Lines • Show All 285 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/** | /** | ||||
* Decide a response for an Avalanche poll about the given transaction. | * Decide a response for an Avalanche poll about the given transaction. | ||||
* | * | ||||
* FIXME This function should be expanded to return different vote responses | * FIXME This function should be expanded to return different vote responses | ||||
* based on inspection of mempool. | * based on inspection of mempool. | ||||
* | * | ||||
* @param[in] CTxMemPool The mempool to base our votes on | * @param[in] mempool The mempool to base our votes on | ||||
* @param[in] TxId The id of the transaction being polled for | * @param[in] id The id of the transaction being polled for | ||||
* @param[out] uint32_t Our current vote for the proof | * @return Our current vote for the proof | ||||
*/ | */ | ||||
static uint32_t getAvalancheVoteForTx(CTxMemPool &mempool, const TxId &id) { | static uint32_t getAvalancheVoteForTx(CTxMemPool &mempool, const TxId &id) { | ||||
return -1; | return -1; | ||||
}; | }; | ||||
/** | /** | ||||
* Decide a response for an Avalanche poll about the given proof. | * Decide a response for an Avalanche poll about the given proof. | ||||
* | * | ||||
* @param[in] avalanche::ProofId The id of the proof being polled for | * @param[in] id The id of the proof being polled for | ||||
* @param[out] uint32_t Our current vote for the proof | * @return Our current vote for the proof | ||||
*/ | */ | ||||
static uint32_t getAvalancheVoteForProof(const avalanche::ProofId &id) { | static uint32_t getAvalancheVoteForProof(const avalanche::ProofId &id) { | ||||
assert(g_avalanche); | assert(g_avalanche); | ||||
// Rejected proof | // Rejected proof | ||||
if (WITH_LOCK(cs_rejectedProofs, return rejectedProofs->contains(id))) { | if (WITH_LOCK(cs_rejectedProofs, return rejectedProofs->contains(id))) { | ||||
return 1; | return 1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,737 Lines • Show Last 20 Lines |