| 2067 | } |
| 2068 | |
| 2069 | void PeerManagerImpl::SendBlockTransactions(CNode& pfrom, const CBlock& block, const BlockTransactionsRequest& req) |
| 2070 | { |
| 2071 | BlockTransactions resp(req); |
| 2072 | for (size_t i = 0; i < req.indexes.size(); i++) { |
| 2073 | if (req.indexes[i] >= block.vtx.size()) { |
| 2074 | Misbehaving(pfrom.GetId(), 100, "getblocktxn with out-of-bounds tx indices"); |
| 2075 | return; |
| 2076 | } |
| 2077 | resp.txn[i] = block.vtx[req.indexes[i]]; |
| 2078 | } |
| 2079 | LOCK(cs_main); |
| 2080 | const CNetMsgMaker msgMaker(pfrom.GetCommonVersion()); |
| 2081 | int nSendFlags = State(pfrom.GetId())->fWantsCmpctWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS; |
| 2082 | m_connman.PushMessage(&pfrom, msgMaker.Make(nSendFlags, NetMsgType::BLOCKTXN, resp)); |
| 2083 | } |
| 2084 | |
| 2085 | void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, const Peer& peer, |
| 2086 | const std::vector<CBlockHeader>& headers, |
nothing calls this directly
no test coverage detected