MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CustomCommit

Method CustomCommit

src/index/blockfilterindex.cpp:136–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136bool BlockFilterIndex::CustomCommit(CDBBatch& batch)
137{
138 const FlatFilePos& pos = m_next_filter_pos;
139
140 // Flush current filter file to disk.
141 AutoFile file{m_filter_fileseq->Open(pos)};
142 if (file.IsNull()) {
143 LogError("Failed to open filter file %d", pos.nFile);
144 return false;
145 }
146 if (!file.Commit()) {
147 LogError("Failed to commit filter file %d", pos.nFile);
148 (void)file.fclose();
149 return false;
150 }
151 if (file.fclose() != 0) {
152 LogError("Failed to close filter file %d after commit: %s", pos.nFile, SysErrorString(errno));
153 return false;
154 }
155
156 batch.Write(DB_FILTER_POS, pos);
157 return true;
158}
159
160bool BlockFilterIndex::ReadFilterFromDisk(const FlatFilePos& pos, const uint256& hash, BlockFilter& filter) const
161{

Callers

nothing calls this directly

Calls 6

SysErrorStringFunction · 0.85
fcloseMethod · 0.80
OpenMethod · 0.45
IsNullMethod · 0.45
CommitMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected