Seems odd to have code that is completely dead.
Fix this by removing all of it.
Seems odd to have code that is completely dead.
Fix this by removing all of it.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
220 | @@ -223,15 +221,6 @@ class HashedSourceWriter : public HashWriter 221 | } 222 | }; 223 | 224 | -/** Compute the 256-bit hash of an object's serialization. */ 225 | -template<typename T> 226 | -uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Why get rid of this helper function? SerializeHash(obj) seems simpler to read than (HashWriter{} << obj).GetHash().
I guess most of the code is combining a few objects and hashing them, so I guess you're right...
Maybe a HashWriter{obj1, obj2, ...}.GetHash() alternative can be used?
template <typename... Ts>
explicit HashWriter(const Ts&... obj)
{
(*this << ... << obj);
}
lets you replace
uint64_t hash1 = (HashWriter{} << nKey << GetKey()).GetCheapHash();
uint64_t hash2 = (HashWriter{} << nKey << netgroupman.GetGroup(*this) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash();
with
uint64_t hash1 = HashWriter{nKey, GetKey()}.GetCheapHash();
uint64_t hash2 = HashWriter{nKey, netgroupman.GetGroup(*this), (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)}.GetCheapHash();
Not sure it's worth it though.
Much of this is done in #28438 I think. You and @ajtowns might want to work together on these :)
I think the two pulls conflict, but they do different things. This one is removing dead code, the other is changing live code. Happy to have them combined or separate, or drop any or all commits.
Each commit can be cherry-picked independently, and the CBufferedFile and CAutoFile one is required for other work anyway, so I guess I'll split that one out and leave this pull in draft for now.
Split out in https://github.com/bitcoin/bitcoin/pull/28458
418 | @@ -419,7 +419,7 @@ class V1Transport final : public Transport 419 | size_t m_bytes_sent GUARDED_BY(m_send_mutex) {0}; 420 | 421 | public: 422 | - V1Transport(const NodeId node_id, int nTypeIn, int nVersionIn) noexcept; 423 | + V1Transport(const NodeId node_id, int nVersionIn) noexcept;
127 | @@ -128,14 +128,14 @@ void PSBTOperationsDialog::broadcastTransaction() 128 | } 129 | 130 | void PSBTOperationsDialog::copyToClipboard() { 131 | - CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); 132 | + CDataStream ssTx{PROTOCOL_VERSION};
Same here, might as well do the transition in one hop instead of two commits, see https://github.com/bitcoin/bitcoin/pull/28912
rebased and added a commit to rename version.h to node/protocol_version.h
Seems odd to not code review ACK fa98a097a30bc39f2424c0efd28a7979155faae6 (looks good)
utACK fa98a097a30bc39f2424c0efd28a7979155faae6
ACK fa98a097a30bc39f2424c0efd28a7979155faae6
rebased and added a commit to rename version.h to node/protocol_version.h
Nice, thanks, I was going to PR the same thing :)