MCPcopy Create free account
hub / github.com/ElementsProject/elements / SerializeDB

Function SerializeDB

src/addrdb.cpp:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31template <typename Stream, typename Data>
32bool SerializeDB(Stream& stream, const Data& data)
33{
34 // Write and commit header, data
35 try {
36 HashedSourceWriter hashwriter{stream};
37 hashwriter << Params().MessageStart() << data;
38 stream << hashwriter.GetHash();
39 } catch (const std::exception& e) {
40 return error("%s: Serialize or I/O error - %s", __func__, e.what());
41 }
42
43 return true;
44}
45
46template <typename Data>
47bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data, int version)

Callers 1

SerializeFileDBFunction · 0.85

Calls 3

errorFunction · 0.85
ParamsClass · 0.70
GetHashMethod · 0.45

Tested by

no test coverage detected