aboutsummaryrefslogtreecommitdiff
path: root/src/core_read.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-11-15 14:59:54 +0000
committerfanquake <fanquake@gmail.com>2023-11-15 15:16:19 +0000
commit108462139b652b62c8461fc264f25b3eeceeaf92 (patch)
tree6b912b7220303ae7e40773ca558dcf2808f6df54 /src/core_read.cpp
parenta73715e5a48c9651720f45a43e4ac5be204201c4 (diff)
parenta0c254c13a3ef21e257cca3493446c632b636b15 (diff)
Merge bitcoin/bitcoin#28438: Use serialization parameters for CTransaction
a0c254c13a3ef21e257cca3493446c632b636b15 Drop CHashWriter (Anthony Towns) c94f7e5b1cd1ddff2a7d95cfad5a83c9dfa526be Drop OverrideStream (Anthony Towns) 6e9e4e6130797b721c8df1eabaf46ec25ebb6abe Use ParamsWrapper for witness serialization (Anthony Towns) Pull request description: Choose whether witness is included in transaction serialization via serialization parameter rather than the stream version. See #25284 and #19477 for previous context. ACKs for top commit: maflcko: re-ACK a0c254c13a3ef21e257cca3493446c632b636b15 🐜 theuni: ACK a0c254c13a3ef21e257cca3493446c632b636b15 Tree-SHA512: 8fd5cadfd84c5128e36c34a51fb94fdccd956280e7f65b7d73c512d6a9cdb53cdd3649de99ffab5322bd34be26cb95ab4eb05932b3b9de9c11d85743f50dcb13
Diffstat (limited to 'src/core_read.cpp')
-rw-r--r--src/core_read.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core_read.cpp b/src/core_read.cpp
index dfabf3a0c2..bffb9e9042 100644
--- a/src/core_read.cpp
+++ b/src/core_read.cpp
@@ -142,9 +142,9 @@ static bool DecodeTx(CMutableTransaction& tx, const std::vector<unsigned char>&
// Try decoding with extended serialization support, and remember if the result successfully
// consumes the entire input.
if (try_witness) {
- CDataStream ssData(tx_data, SER_NETWORK, PROTOCOL_VERSION);
+ DataStream ssData(tx_data);
try {
- ssData >> tx_extended;
+ ssData >> TX_WITH_WITNESS(tx_extended);
if (ssData.empty()) ok_extended = true;
} catch (const std::exception&) {
// Fall through.
@@ -160,9 +160,9 @@ static bool DecodeTx(CMutableTransaction& tx, const std::vector<unsigned char>&
// Try decoding with legacy serialization, and remember if the result successfully consumes the entire input.
if (try_no_witness) {
- CDataStream ssData(tx_data, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);
+ DataStream ssData(tx_data);
try {
- ssData >> tx_legacy;
+ ssData >> TX_NO_WITNESS(tx_legacy);
if (ssData.empty()) ok_legacy = true;
} catch (const std::exception&) {
// Fall through.
@@ -222,9 +222,9 @@ bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk)
return false;
std::vector<unsigned char> blockData(ParseHex(strHexBlk));
- CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION);
+ DataStream ssBlock(blockData);
try {
- ssBlock >> block;
+ ssBlock >> TX_WITH_WITNESS(block);
}
catch (const std::exception&) {
return false;