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

Function SerializeDB

src/addrdb.cpp:38–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template <typename Stream, typename Data>
38bool SerializeDB(Stream& stream, const Data& data)
39{
40 // Write and commit header, data
41 try {
42 HashedSourceWriter hashwriter{stream};
43 hashwriter << Params().MessageStart() << data;
44 stream << hashwriter.GetHash();
45 } catch (const std::exception& e) {
46 LogError("%s: Serialize or I/O error - %s\n", __func__, e.what());
47 return false;
48 }
49
50 return true;
51}
52
53template <typename Data>
54bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data)

Callers 1

SerializeFileDBFunction · 0.85

Calls 3

ParamsClass · 0.70
GetHashMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected