mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge 108462139b into merged_master (Bitcoin PR bitcoin/bitcoin#28438)
This commit is contained in:
commit
8cf8bd5564
85 changed files with 444 additions and 489 deletions
|
|
@ -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.
|
||||
|
|
@ -207,9 +207,9 @@ bool DecodeHexBlockHeader(CBlockHeader& header, const std::string& hex_header)
|
|||
if (!IsHex(hex_header)) return false;
|
||||
|
||||
const std::vector<unsigned char> header_data{ParseHex(hex_header)};
|
||||
CDataStream ser_header(header_data, SER_NETWORK, PROTOCOL_VERSION);
|
||||
DataStream ser_header(header_data);
|
||||
try {
|
||||
ser_header >> header;
|
||||
ser_header >> TX_WITH_WITNESS(header);
|
||||
} catch (const std::exception&) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue