mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
changed elements serialization to new style with no marker 0x00 byte and witness data at the end
This commit is contained in:
parent
de19cfe797
commit
d3a48d59e3
8 changed files with 43 additions and 79 deletions
|
|
@ -88,26 +88,13 @@ CScript ParseScript(const std::string& s)
|
|||
return result;
|
||||
}
|
||||
|
||||
bool DecodeHexTx(CMutableTransaction& tx, const std::string& strHexTx, bool fTryNoWitness)
|
||||
bool DecodeHexTx(CMutableTransaction& tx, const std::string& strHexTx)
|
||||
{
|
||||
if (!IsHex(strHexTx))
|
||||
return false;
|
||||
|
||||
std::vector<unsigned char> txData(ParseHex(strHexTx));
|
||||
|
||||
if (fTryNoWitness) {
|
||||
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);
|
||||
try {
|
||||
ssData >> tx;
|
||||
if (ssData.eof()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (const std::exception&) {
|
||||
// Fall through.
|
||||
}
|
||||
}
|
||||
|
||||
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
|
||||
try {
|
||||
ssData >> tx;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue