MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SendBlockTransactions

Function SendBlockTransactions

src/net_processing.cpp:1335–1349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1333}
1334
1335inline void static SendBlockTransactions(const CBlock& block, const BlockTransactionsRequest& req, CNode* pfrom, CConnman* connman) {
1336 BlockTransactions resp(req);
1337 for (size_t i = 0; i < req.indexes.size(); i++) {
1338 if (req.indexes[i] >= block.vtx.size()) {
1339 LOCK(cs_main);
1340 Misbehaving(pfrom->GetId(), 100, strprintf("Peer %d sent us a getblocktxn with out-of-bounds tx indices", pfrom->GetId()));
1341 return;
1342 }
1343 resp.txn[i] = block.vtx[req.indexes[i]];
1344 }
1345 LOCK(cs_main);
1346 const CNetMsgMaker msgMaker(pfrom->GetSendVersion());
1347 int nSendFlags = State(pfrom->GetId())->fWantsCmpctWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS;
1348 connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::BLOCKTXN, resp));
1349}
1350
1351bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::vector<CBlockHeader>& headers, const CChainParams& chainparams, bool punish_duplicate_invalid)
1352{

Callers 1

ProcessMessageFunction · 0.85

Calls 6

GetIdMethod · 0.80
GetSendVersionMethod · 0.80
PushMessageMethod · 0.80
MakeMethod · 0.80
StateClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected