Page MenuHomePhabricator

Remove CHashWriter type
ClosedPublic

Authored by PiRK on Dec 17 2025, 11:34.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC4c8d16518217: Remove CHashWriter type
Summary

The type is only ever set, but never read via GetType(), so remove it.
Also, remove SerializeHash to avoid silent merge conflicts and use the
already existing GetHash() boilerplate consistently.

This is a partial backport of core#28508
https://github.com/bitcoin/bitcoin/pull/28508/commits/fa72f09d6ff8ee204f331a69d3f5e825223c9e11
https://github.com/bitcoin/bitcoin/pull/28341/commits/99995cfe8da6ea2b93a6cd0e0bc84bb34cbb9d8c (addrman.cpp callsite missed in D16472 because we didn't backport core#22910)
Depends on D19143

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Dec 17 2025, 11:34
Fabien requested changes to this revision.Dec 17 2025, 13:39
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/addrman.cpp
365 ↗(On Diff #57167)

This is a change in behavior? Should be PROTOCOL_VERSION instead of 0 ?

This revision now requires changes to proceed.Dec 17 2025, 13:39
PiRK planned changes to this revision.Dec 17 2025, 14:30
PiRK added inline comments.
src/addrman.cpp
365 ↗(On Diff #57167)

I messed up the backport from core#23341
It should be changed to a HashWriter without a version, and the fact that this compiles proves the version is unused by the serialization code.

use a HashWriter instead of CHashWriter in addrman.cpp

This revision is now accepted and ready to land.Dec 17 2025, 16:19
This revision was automatically updated to reflect the committed changes.