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.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
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.
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)
SerializeHash(obj)
seems simpler to read than (HashWriter{} << obj).GetHash()
.
HashWriter{obj1, obj2, ...}.GetHash()
alternative can be used?
0 template <typename... Ts>
1 explicit HashWriter(const Ts&... obj)
2 {
3 (*this << ... << obj);
4 }
lets you replace
0 uint64_t hash1 = (HashWriter{} << nKey << GetKey()).GetCheapHash();
1 uint64_t hash2 = (HashWriter{} << nKey << netgroupman.GetGroup(*this) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash();
with
0 uint64_t hash1 = HashWriter{nKey, GetKey()}.GetCheapHash();
1 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.
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};
rebased and added a commit to rename version.h to node/protocol_version.h
Nice, thanks, I was going to PR the same thing :)