| 1333 | } |
| 1334 | |
| 1335 | inline 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 | |
| 1351 | bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::vector<CBlockHeader>& headers, const CChainParams& chainparams, bool punish_duplicate_invalid) |
| 1352 | { |
no test coverage detected