mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Merge bitcoin/bitcoin#28473: refactor: Serialization parameter cleanups
fb6a2ab63escripted-diff: use SER_PARAMS_OPFUNC (Anthony Towns)5e5c8f86b6serialize: add SER_PARAMS_OPFUNC (Anthony Towns)33203f59b4serialize: specify type for ParamsWrapper not ref (Anthony Towns)bf147bfffaserialize: move ser_action functions out of global namespace (Anthony Towns) Pull request description: Cleanups after #25284: * ser_action namespacing - https://github.com/bitcoin/bitcoin/pull/25284#discussion_r1316189977 * make reference implicit - https://github.com/bitcoin/bitcoin/pull/25284#discussion_r1316277030 * function notation - https://github.com/bitcoin/bitcoin/pull/25284#issuecomment-1710714821 ACKs for top commit: MarcoFalke: lgtm ACKfb6a2ab63e💨 TheCharlatan: ACKfb6a2ab63eTree-SHA512: aacca2ee9cfec360ade6b394606e13d1dfe05bc29c5fbdd48a4e6992bd420312d4ed0d32218d95c560646af326e9977728dc2e759990636298e326947f6f9526
This commit is contained in:
@@ -216,14 +216,14 @@ util::Result<std::unique_ptr<AddrMan>> LoadAddrman(const NetGroupManager& netgro
|
||||
void DumpAnchors(const fs::path& anchors_db_path, const std::vector<CAddress>& anchors)
|
||||
{
|
||||
LOG_TIME_SECONDS(strprintf("Flush %d outbound block-relay-only peer addresses to anchors.dat", anchors.size()));
|
||||
SerializeFileDB("anchors", anchors_db_path, WithParams(CAddress::V2_DISK, anchors));
|
||||
SerializeFileDB("anchors", anchors_db_path, CAddress::V2_DISK(anchors));
|
||||
}
|
||||
|
||||
std::vector<CAddress> ReadAnchors(const fs::path& anchors_db_path)
|
||||
{
|
||||
std::vector<CAddress> anchors;
|
||||
try {
|
||||
DeserializeFileDB(anchors_db_path, WithParams(CAddress::V2_DISK, anchors));
|
||||
DeserializeFileDB(anchors_db_path, CAddress::V2_DISK(anchors));
|
||||
LogPrintf("Loaded %i addresses from %s\n", anchors.size(), fs::quoted(fs::PathToString(anchors_db_path.filename())));
|
||||
} catch (const std::exception&) {
|
||||
anchors.clear();
|
||||
|
||||
Reference in New Issue
Block a user