mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
BIP144: Serialization, hashes, relay (sender side)
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
This commit is contained in:
@@ -276,7 +276,7 @@ UniValue gettxoutproof(const UniValue& params, bool fHelp)
|
||||
if (ntxFound != setTxids.size())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "(Not all) transactions not found in specified block");
|
||||
|
||||
CDataStream ssMB(SER_NETWORK, PROTOCOL_VERSION);
|
||||
CDataStream ssMB(SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);
|
||||
CMerkleBlock mb(block, setTxids);
|
||||
ssMB << mb;
|
||||
std::string strHex = HexStr(ssMB.begin(), ssMB.end());
|
||||
@@ -296,7 +296,7 @@ UniValue verifytxoutproof(const UniValue& params, bool fHelp)
|
||||
"[\"txid\"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid\n"
|
||||
);
|
||||
|
||||
CDataStream ssMB(ParseHexV(params[0], "proof"), SER_NETWORK, PROTOCOL_VERSION);
|
||||
CDataStream ssMB(ParseHexV(params[0], "proof"), SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);
|
||||
CMerkleBlock merkleBlock;
|
||||
ssMB >> merkleBlock;
|
||||
|
||||
@@ -487,7 +487,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp)
|
||||
|
||||
CTransaction tx;
|
||||
|
||||
if (!DecodeHexTx(tx, params[0].get_str()))
|
||||
if (!DecodeHexTx(tx, params[0].get_str(), true))
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
|
||||
Reference in New Issue
Block a user