MCPcopy Create free account
hub / github.com/LUX-Core/lux / DecodeHexTx

Function DecodeHexTx

src/core_read.cpp:83–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx, bool fTryNoWitness)
84{
85 if (!IsHex(strHexTx))
86 return false;
87
88 vector<unsigned char> txData(ParseHex(strHexTx));
89
90 if (fTryNoWitness) {
91 CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);
92 try {
93 ssData >> tx;
94 if (ssData.eof()) {
95 return true;
96 }
97 }
98 catch (const std::exception&) {
99 // Fall through.
100 }
101 }
102
103 CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
104 try {
105 ssData >> tx;
106 } catch (const std::exception&) {
107 return false;
108 }
109
110 return true;
111}
112
113bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk)
114{

Callers 5

CommandLineRawTxFunction · 0.85
importprunedfundsFunction · 0.85
fundrawtransactionFunction · 0.85
decoderawtransactionFunction · 0.85
sendrawtransactionFunction · 0.85

Calls 3

IsHexFunction · 0.85
ParseHexFunction · 0.85
eofMethod · 0.45

Tested by

no test coverage detected