| 244 | } |
| 245 | |
| 246 | bool TxIndex::WriteBlock(const CBlock& block, const CBlockIndex* pindex) |
| 247 | { |
| 248 | CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size())); |
| 249 | std::vector<std::pair<uint256, CDiskTxPos>> vPos; |
| 250 | vPos.reserve(block.vtx.size()); |
| 251 | for (const auto& tx : block.vtx) { |
| 252 | vPos.emplace_back(tx->GetHash(), pos); |
| 253 | pos.nTxOffset += ::GetSerializeSize(*tx, SER_DISK, CLIENT_VERSION); |
| 254 | } |
| 255 | return m_db->WriteTxs(vPos); |
| 256 | } |
| 257 | |
| 258 | BaseIndex::DB& TxIndex::GetDB() const { return *m_db; } |
| 259 |
nothing calls this directly
no test coverage detected