aboutsummaryrefslogtreecommitdiff
path: root/src/streams.h
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-02-02 10:39:17 +0000
committerfanquake <fanquake@gmail.com>2023-02-02 10:47:37 +0000
commit21138fe37724c66dad3b27799c70c6778d004214 (patch)
treea854fef13e8446afa992a61cb98d983990356643 /src/streams.h
parent9dc50a5a0788fa07fa67e9ffa1457e53aa9a0e53 (diff)
parentfa47b28dfc2a6577519e10da68ebd8da93568434 (diff)
downloadbitcoin-21138fe37724c66dad3b27799c70c6778d004214.tar.xz
Merge bitcoin/bitcoin#26992: refactor: Remove unused CDataStream SerializeMany constructor
fa47b28dfc2a6577519e10da68ebd8da93568434 refactor: Remove unused CDataStream SerializeMany constructor (MarcoFalke) Pull request description: Seems odd to have an unused method. Moreover, the function is fragile and dangerous, because one could have a `std::vector vec_a` and type `CDataStream{vec_a, 0, 0}.size()` and `CDataStream{0, 0, vec_a}.size()`, assuming they are the same thing, when in fact they are not. (The first takes over the memory as is, the second serializes the vector). So my suggestion would be to remove the unused method and introduce a new method when this functionality is needed. For example: `static DataStream FromMany(Args&&... args)`. ACKs for top commit: stickies-v: ACK fa47b28dfc2a6577519e10da68ebd8da93568434 Tree-SHA512: 9593a034b997e33a0794f779f76f02425b1097b218cf8cb1facb7f874fa69da328ce567a79138015baeebe004ae7d103dda4f64f83e8ad375b6dae6b66d3d950
Diffstat (limited to 'src/streams.h')
-rw-r--r--src/streams.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/streams.h b/src/streams.h
index ed9af308c9..8788343809 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -358,14 +358,6 @@ public:
nType{nTypeIn},
nVersion{nVersionIn} {}
- template <typename... Args>
- CDataStream(int nTypeIn, int nVersionIn, Args&&... args)
- : nType{nTypeIn},
- nVersion{nVersionIn}
- {
- ::SerializeMany(*this, std::forward<Args>(args)...);
- }
-
int GetType() const { return nType; }
void SetVersion(int n) { nVersion = n; }
int GetVersion() const { return nVersion; }