Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 280 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 2) | ||||
"1. \"rawtransaction\" (string, required) A raw transaction in hex " | "1. \"rawtransaction\" (string, required) A raw transaction in hex " | ||||
"funding an already-existing address in wallet\n" | "funding an already-existing address in wallet\n" | ||||
"2. \"txoutproof\" (string, required) The hex output from " | "2. \"txoutproof\" (string, required) The hex output from " | ||||
"gettxoutproof that contains the transaction\n"); | "gettxoutproof that contains the transaction\n"); | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
if (!DecodeHexTx(tx, request.params[0].get_str())) | if (!DecodeHexTx(tx, request.params[0].get_str())) | ||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); | ||||
uint256 txid = tx.GetId(); | uint256 txid = tx.GetHash(); | ||||
CWalletTx wtx(pwalletMain, MakeTransactionRef(std::move(tx))); | CWalletTx wtx(pwalletMain, MakeTransactionRef(std::move(tx))); | ||||
CDataStream ssMB(ParseHexV(request.params[1], "proof"), SER_NETWORK, | CDataStream ssMB(ParseHexV(request.params[1], "proof"), SER_NETWORK, | ||||
PROTOCOL_VERSION); | PROTOCOL_VERSION); | ||||
CMerkleBlock merkleBlock; | CMerkleBlock merkleBlock; | ||||
ssMB >> merkleBlock; | ssMB >> merkleBlock; | ||||
// Search partial merkle tree in proof for our transaction and index in | // Search partial merkle tree in proof for our transaction and index in | ||||
▲ Show 20 Lines • Show All 951 Lines • Show Last 20 Lines |