2017-11-09 19:34:51 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
|
|
|
|
* Copyright (C) 2010 Satoshi Nakamoto
|
|
|
|
|
* Copyright (C) 2009-2015 The Bitcoin Core developers
|
2021-01-20 19:21:53 +01:00
|
|
|
* Copyright (C) 2016-2021 Tom Zander <tom@flowee.org>
|
2017-11-09 19:34:51 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2017-07-24 22:40:28 +02:00
|
|
|
#include <Application.h>
|
2019-04-11 11:33:27 +02:00
|
|
|
#include "encodings_legacy.h"
|
2015-07-05 14:17:46 +02:00
|
|
|
#include "chain.h"
|
2018-01-15 15:26:12 +00:00
|
|
|
#include <validation/Engine.h>
|
2014-06-23 23:10:24 -04:00
|
|
|
#include "core_io.h"
|
2014-01-11 18:14:29 +01:00
|
|
|
#include "main.h"
|
2014-11-01 16:01:48 -07:00
|
|
|
#include "merkleblock.h"
|
2014-01-11 18:14:29 +01:00
|
|
|
#include "net.h"
|
2015-06-24 07:25:30 +02:00
|
|
|
#include "policy/policy.h"
|
2015-01-24 15:57:12 +01:00
|
|
|
#include "primitives/transaction.h"
|
2014-01-11 18:14:29 +01:00
|
|
|
#include "rpcserver.h"
|
2019-03-11 14:47:12 +01:00
|
|
|
#include "primitives/script.h"
|
2014-09-14 12:43:56 +02:00
|
|
|
#include "script/standard.h"
|
2015-07-05 14:17:46 +02:00
|
|
|
#include "txmempool.h"
|
2017-02-14 11:17:46 +01:00
|
|
|
#include "BlocksDB.h"
|
2014-01-11 18:14:29 +01:00
|
|
|
#include "uint256.h"
|
2015-07-05 14:17:46 +02:00
|
|
|
#include "utilstrencodings.h"
|
2026-05-14 13:13:40 +02:00
|
|
|
#include "chainparams.h"
|
2018-07-23 18:05:43 +02:00
|
|
|
#include <utxo/UnspentOutputDatabase.h>
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2013-04-13 00:13:08 -05:00
|
|
|
#include <boost/assign/list_of.hpp>
|
2018-12-30 15:33:11 +01:00
|
|
|
#include <boost/foreach.hpp>
|
2021-11-02 10:23:33 +01:00
|
|
|
#include <primitives/Block.h>
|
2022-07-06 22:50:53 +02:00
|
|
|
#include <BitcoinVersion.h>
|
2013-04-13 00:13:08 -05:00
|
|
|
|
2015-09-04 16:11:34 +02:00
|
|
|
#include <univalue.h>
|
2015-05-18 14:02:18 +02:00
|
|
|
|
|
|
|
|
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex)
|
2012-05-31 16:01:16 -04:00
|
|
|
{
|
2019-06-06 21:37:49 +02:00
|
|
|
Script::TxnOutType type;
|
2017-08-02 19:53:22 +05:30
|
|
|
std::vector<CTxDestination> addresses;
|
2012-05-31 16:01:16 -04:00
|
|
|
int nRequired;
|
|
|
|
|
|
2015-07-30 19:56:00 -04:00
|
|
|
out.push_back(Pair("asm", ScriptToAsmStr(scriptPubKey)));
|
2013-07-15 01:22:10 -04:00
|
|
|
if (fIncludeHex)
|
|
|
|
|
out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())));
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2014-06-25 21:09:36 -04:00
|
|
|
if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) {
|
2019-06-06 21:37:49 +02:00
|
|
|
out.push_back(Pair("type", Script::getTxnOutputType(type)));
|
2012-05-31 16:01:16 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
out.push_back(Pair("reqSigs", nRequired));
|
2019-06-06 21:37:49 +02:00
|
|
|
out.push_back(Pair("type", Script::getTxnOutputType(type)));
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue a(UniValue::VARR);
|
2012-05-31 16:01:16 -04:00
|
|
|
BOOST_FOREACH(const CTxDestination& addr, addresses)
|
|
|
|
|
a.push_back(CBitcoinAddress(addr).ToString());
|
|
|
|
|
out.push_back(Pair("addresses", a));
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
|
2012-05-31 16:01:16 -04:00
|
|
|
{
|
|
|
|
|
entry.push_back(Pair("txid", tx.GetHash().GetHex()));
|
2015-11-21 05:35:11 +03:00
|
|
|
entry.push_back(Pair("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)));
|
2012-05-31 16:01:16 -04:00
|
|
|
entry.push_back(Pair("version", tx.nVersion));
|
2014-05-05 20:08:13 +02:00
|
|
|
entry.push_back(Pair("locktime", (int64_t)tx.nLockTime));
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue vin(UniValue::VARR);
|
2014-06-25 21:09:36 -04:00
|
|
|
BOOST_FOREACH(const CTxIn& txin, tx.vin) {
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue in(UniValue::VOBJ);
|
2012-05-31 16:01:16 -04:00
|
|
|
if (tx.IsCoinBase())
|
|
|
|
|
in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
|
2014-06-25 21:09:36 -04:00
|
|
|
else {
|
2012-05-31 16:01:16 -04:00
|
|
|
in.push_back(Pair("txid", txin.prevout.hash.GetHex()));
|
2014-05-05 20:08:13 +02:00
|
|
|
in.push_back(Pair("vout", (int64_t)txin.prevout.n));
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue o(UniValue::VOBJ);
|
2015-07-30 19:56:00 -04:00
|
|
|
o.push_back(Pair("asm", ScriptToAsmStr(txin.scriptSig, true)));
|
2012-05-31 16:01:16 -04:00
|
|
|
o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
|
|
|
|
|
in.push_back(Pair("scriptSig", o));
|
|
|
|
|
}
|
2014-05-05 20:08:13 +02:00
|
|
|
in.push_back(Pair("sequence", (int64_t)txin.nSequence));
|
2012-05-31 16:01:16 -04:00
|
|
|
vin.push_back(in);
|
|
|
|
|
}
|
|
|
|
|
entry.push_back(Pair("vin", vin));
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue vout(UniValue::VARR);
|
2014-06-25 21:09:36 -04:00
|
|
|
for (unsigned int i = 0; i < tx.vout.size(); i++) {
|
2012-05-31 16:01:16 -04:00
|
|
|
const CTxOut& txout = tx.vout[i];
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue out(UniValue::VOBJ);
|
2012-05-31 16:01:16 -04:00
|
|
|
out.push_back(Pair("value", ValueFromAmount(txout.nValue)));
|
2014-05-05 20:08:13 +02:00
|
|
|
out.push_back(Pair("n", (int64_t)i));
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue o(UniValue::VOBJ);
|
2013-12-06 15:56:38 -08:00
|
|
|
ScriptPubKeyToJSON(txout.scriptPubKey, o, true);
|
2012-05-31 16:01:16 -04:00
|
|
|
out.push_back(Pair("scriptPubKey", o));
|
|
|
|
|
vout.push_back(out);
|
|
|
|
|
}
|
|
|
|
|
entry.push_back(Pair("vout", vout));
|
|
|
|
|
|
2014-12-15 09:11:16 +01:00
|
|
|
if (!hashBlock.IsNull()) {
|
2012-05-31 16:01:16 -04:00
|
|
|
entry.push_back(Pair("blockhash", hashBlock.GetHex()));
|
2018-01-15 15:26:12 +00:00
|
|
|
CBlockIndex* pindex = Blocks::Index::get(hashBlock);
|
|
|
|
|
if (pindex) {
|
2014-06-25 21:09:36 -04:00
|
|
|
if (chainActive.Contains(pindex)) {
|
2013-10-10 23:07:44 +02:00
|
|
|
entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight));
|
2014-06-28 23:36:06 +02:00
|
|
|
entry.push_back(Pair("time", pindex->GetBlockTime()));
|
|
|
|
|
entry.push_back(Pair("blocktime", pindex->GetBlockTime()));
|
2012-05-31 16:01:16 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
entry.push_back(Pair("confirmations", 0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
UniValue getrawtransaction(const UniValue& params, bool fHelp)
|
2012-05-31 16:01:16 -04:00
|
|
|
{
|
2021-03-03 10:17:14 +01:00
|
|
|
if (fHelp || params.size() < 1 || params.size() > 3)
|
|
|
|
|
throw std::runtime_error("getrawtransaction"
|
|
|
|
|
"\nNOTE: By default this function only works for mempool transactions. If the -txindex option is\n"
|
|
|
|
|
"enabled, it also works for blockchain transactions. If the block which contains the transaction\n"
|
|
|
|
|
"is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is\n"
|
|
|
|
|
"provided, only that block will be searched and if the transaction is in the mempool or other\n"
|
|
|
|
|
"blocks, or if this node does not have the given block available, the transaction will not be found.\n"
|
|
|
|
|
"DEPRECATED: for now, it also works for transactions with unspent outputs.\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"Return the raw transaction data.\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"If verbose is 'true', returns an Object with information about 'txid'.\n"
|
|
|
|
|
"If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
|
2021-03-03 10:17:14 +01:00
|
|
|
"\narguments:\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
"1. \"txid\" (string, required) The transaction id\n"
|
|
|
|
|
"2. verbose (numeric, optional, default=0) If 0, return a string, other return a json object\n"
|
2021-03-03 10:17:14 +01:00
|
|
|
"3. blockhash (string, required) The block in which to look for the transaction\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
|
2021-03-03 10:17:14 +01:00
|
|
|
"\nResult (if verbose is not set or set to false):\n"
|
|
|
|
|
"\"data\" (string) The serialized, hex-encoded data for "
|
|
|
|
|
"'txid'\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
|
2021-03-03 10:17:14 +01:00
|
|
|
"\nResult (if verbose is set to true):\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
"{\n"
|
|
|
|
|
" \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n"
|
|
|
|
|
" \"txid\" : \"id\", (string) The transaction id (same as provided)\n"
|
2021-03-03 10:17:14 +01:00
|
|
|
" \"hash\" : \"id\", (string) The transaction hash\n"
|
|
|
|
|
" \"size\" : n, (numeric) The serialized transaction size\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" \"version\" : n, (numeric) The version\n"
|
|
|
|
|
" \"locktime\" : ttt, (numeric) The lock time\n"
|
|
|
|
|
" \"vin\" : [ (array of json objects)\n"
|
|
|
|
|
" {\n"
|
|
|
|
|
" \"txid\": \"id\", (string) The transaction id\n"
|
2021-03-03 10:17:14 +01:00
|
|
|
" \"vout\": n, (numeric)\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" \"scriptSig\": { (json object) The script\n"
|
|
|
|
|
" \"asm\": \"asm\", (string) asm\n"
|
|
|
|
|
" \"hex\": \"hex\" (string) hex\n"
|
|
|
|
|
" },\n"
|
|
|
|
|
" \"sequence\": n (numeric) The script sequence number\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" ,...\n"
|
|
|
|
|
" ],\n"
|
|
|
|
|
" \"vout\" : [ (array of json objects)\n"
|
|
|
|
|
" {\n"
|
2021-01-20 19:21:53 +01:00
|
|
|
" \"value\" : x.xxx, (numeric) The value in BCH\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" \"n\" : n, (numeric) index\n"
|
|
|
|
|
" \"scriptPubKey\" : { (json object)\n"
|
|
|
|
|
" \"asm\" : \"asm\", (string) the asm\n"
|
|
|
|
|
" \"hex\" : \"hex\", (string) the hex\n"
|
|
|
|
|
" \"reqSigs\" : n, (numeric) The required sigs\n"
|
|
|
|
|
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
|
|
|
|
|
" \"addresses\" : [ (json array of string)\n"
|
2021-03-03 10:17:14 +01:00
|
|
|
" \"address\" (string) Bitcoin Cash address\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" ,...\n"
|
|
|
|
|
" ]\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" ,...\n"
|
|
|
|
|
" ],\n"
|
|
|
|
|
" \"blockhash\" : \"hash\", (string) the block hash\n"
|
|
|
|
|
" \"confirmations\" : n, (numeric) The confirmations\n"
|
|
|
|
|
" \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n"
|
2021-03-03 10:17:14 +01:00
|
|
|
" \"blocktime\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n"
|
|
|
|
|
" \"in_active_chain\": b (bool) Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
"}\n"
|
|
|
|
|
|
2021-03-03 10:17:14 +01:00
|
|
|
"\nExamples:\n" +
|
|
|
|
|
HelpExampleCli("getrawtransaction", "\"mytxid\"") +
|
|
|
|
|
HelpExampleCli("getrawtransaction", "\"mytxid\" true") +
|
|
|
|
|
HelpExampleRpc("getrawtransaction", "\"mytxid\", true") +
|
|
|
|
|
HelpExampleCli("getrawtransaction", "\"mytxid\" false \"myblockhash\"") +
|
|
|
|
|
HelpExampleCli("getrawtransaction", "\"mytxid\" true \"myblockhash\""));
|
|
|
|
|
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2014-10-19 04:46:17 -04:00
|
|
|
LOCK(cs_main);
|
|
|
|
|
|
2021-03-03 10:17:14 +01:00
|
|
|
bool in_active_chain = true;
|
2012-09-07 20:54:27 -04:00
|
|
|
uint256 hash = ParseHashV(params[0], "parameter 1");
|
2012-05-31 16:01:16 -04:00
|
|
|
|
|
|
|
|
bool fVerbose = false;
|
2020-01-13 23:23:49 +01:00
|
|
|
if (!params[1].isNull()) {
|
|
|
|
|
fVerbose = params[1].isNum() ? (params[1].get_int() != 0) : params[1].get_bool();
|
|
|
|
|
}
|
2012-05-31 16:01:16 -04:00
|
|
|
|
|
|
|
|
CTransaction tx;
|
2021-03-03 10:17:14 +01:00
|
|
|
bool success = false;
|
|
|
|
|
bool fromBlock = false;
|
|
|
|
|
if (!params[2].isNull()) { // we got a block hash, look up in that block.
|
|
|
|
|
fromBlock = true;
|
|
|
|
|
uint256 blockId = ParseHashV(params[2], "parameter 2");
|
|
|
|
|
auto index = Blocks::Index::get(blockId);
|
|
|
|
|
if (!index)
|
|
|
|
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block hash not found");
|
|
|
|
|
in_active_chain = Blocks::DB::instance()->headerChain().Contains(index);
|
|
|
|
|
|
2021-03-10 18:04:57 +01:00
|
|
|
|
2022-02-22 16:11:34 +01:00
|
|
|
Block block;
|
|
|
|
|
try {
|
|
|
|
|
block = Blocks::DB::instance()->loadBlock(index->GetBlockPos());
|
|
|
|
|
} catch (...) {
|
|
|
|
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not available");
|
2021-03-03 10:17:14 +01:00
|
|
|
}
|
2022-02-22 16:11:34 +01:00
|
|
|
const int ctorHeight = Params().GetConsensus().hf201811Height;
|
|
|
|
|
auto ftx = block.findTransaction(hash, index->nHeight >= ctorHeight);
|
|
|
|
|
if (ftx.size() > 0) {
|
|
|
|
|
success = true;
|
|
|
|
|
tx = ftx.createOldTransaction();
|
2021-03-03 10:17:14 +01:00
|
|
|
}
|
2021-03-10 18:04:57 +01:00
|
|
|
if (!success)
|
2021-03-03 10:17:14 +01:00
|
|
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No such transaction found in the provided block");
|
2019-05-08 12:49:33 +02:00
|
|
|
}
|
2021-03-03 10:17:14 +01:00
|
|
|
else {
|
|
|
|
|
// we just get it from the mempool.
|
|
|
|
|
success = flApp->mempool()->lookup(hash, tx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!success) {
|
|
|
|
|
const int ctorHeight = Params().GetConsensus().hf201811Height;
|
|
|
|
|
auto index = chainActive.Tip();
|
|
|
|
|
for (int i = 0; !success && index && i < 6; ++i) {
|
2022-02-22 16:11:34 +01:00
|
|
|
Block block = Blocks::DB::instance()->loadBlock(index->GetBlockPos());
|
|
|
|
|
auto ftx = block.findTransaction(hash, index->nHeight >= ctorHeight);
|
|
|
|
|
if (ftx.size() > 0) {
|
|
|
|
|
tx = ftx.createOldTransaction();
|
|
|
|
|
success = true;
|
|
|
|
|
break;
|
2021-03-03 10:17:14 +01:00
|
|
|
}
|
|
|
|
|
index = index->pprev;
|
|
|
|
|
}
|
|
|
|
|
if (!success)
|
|
|
|
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No such mempool transaction.");
|
|
|
|
|
}
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2017-08-02 19:53:22 +05:30
|
|
|
std::string strHex = EncodeHexTx(tx);
|
2012-05-31 16:01:16 -04:00
|
|
|
|
|
|
|
|
if (!fVerbose)
|
|
|
|
|
return strHex;
|
|
|
|
|
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue result(UniValue::VOBJ);
|
2012-05-31 16:01:16 -04:00
|
|
|
result.push_back(Pair("hex", strHex));
|
2019-04-10 17:55:08 +02:00
|
|
|
uint256 hashBlock;
|
2012-05-31 16:01:16 -04:00
|
|
|
TxToJSON(tx, hashBlock, result);
|
2021-03-03 10:17:14 +01:00
|
|
|
if (fromBlock) {
|
|
|
|
|
result.push_back(Pair("in_active_chain", in_active_chain));
|
|
|
|
|
}
|
2012-05-31 16:01:16 -04:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
UniValue verifytxoutproof(const UniValue& params, bool fHelp)
|
2014-11-01 16:01:48 -07:00
|
|
|
{
|
|
|
|
|
if (fHelp || params.size() != 1)
|
2017-08-02 19:53:22 +05:30
|
|
|
throw std::runtime_error(
|
2014-11-01 16:01:48 -07:00
|
|
|
"verifytxoutproof \"proof\"\n"
|
|
|
|
|
"\nVerifies that a proof points to a transaction in a block, returning the transaction it commits to\n"
|
|
|
|
|
"and throwing an RPC error if the block is not in our best chain\n"
|
|
|
|
|
"\nArguments:\n"
|
2018-07-23 18:05:43 +02:00
|
|
|
"1. \"proof\" (string, required) The hex-encoded proof\n"
|
2014-11-01 16:01:48 -07:00
|
|
|
"\nResult:\n"
|
|
|
|
|
"[\"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);
|
|
|
|
|
CMerkleBlock merkleBlock;
|
|
|
|
|
ssMB >> merkleBlock;
|
|
|
|
|
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue res(UniValue::VARR);
|
2014-11-01 16:01:48 -07:00
|
|
|
|
2017-08-02 19:53:22 +05:30
|
|
|
std::vector<uint256> vMatch;
|
2014-11-01 16:01:48 -07:00
|
|
|
if (merkleBlock.txn.ExtractMatches(vMatch) != merkleBlock.header.hashMerkleRoot)
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
|
|
|
2021-11-02 09:28:35 +01:00
|
|
|
auto item = Blocks::Index::get(merkleBlock.header.createHash());
|
2018-01-15 15:26:12 +00:00
|
|
|
if (!item || !chainActive.Contains(item))
|
2014-11-01 16:01:48 -07:00
|
|
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found in chain");
|
|
|
|
|
|
|
|
|
|
BOOST_FOREACH(const uint256& hash, vMatch)
|
|
|
|
|
res.push_back(hash.GetHex());
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
2012-05-31 16:01:16 -04:00
|
|
|
{
|
2016-08-24 20:56:49 +02:00
|
|
|
if (fHelp || params.size() < 2 || params.size() > 4)
|
2017-08-02 19:53:22 +05:30
|
|
|
throw std::runtime_error(
|
2016-08-24 20:56:49 +02:00
|
|
|
"createrawtransaction [{\"txid\":\"id\",\"vout\":n},...] {\"address\":amount,\"data\":\"hex\",...} ( locktime, txversion )\n"
|
2015-06-29 20:14:02 +02:00
|
|
|
"\nCreate a transaction spending the given inputs and creating new outputs.\n"
|
|
|
|
|
"Outputs can be addresses or data.\n"
|
2012-05-31 16:01:16 -04:00
|
|
|
"Returns hex-encoded raw transaction.\n"
|
|
|
|
|
"Note that the transaction's inputs are not signed, and\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
"it is not stored in the wallet or transmitted to the network.\n"
|
|
|
|
|
|
|
|
|
|
"\nArguments:\n"
|
|
|
|
|
"1. \"transactions\" (string, required) A json array of json objects\n"
|
|
|
|
|
" [\n"
|
|
|
|
|
" {\n"
|
2015-06-29 20:14:02 +02:00
|
|
|
" \"txid\":\"id\", (string, required) The transaction id\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" \"vout\":n (numeric, required) The output number\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" ,...\n"
|
|
|
|
|
" ]\n"
|
2015-06-29 20:14:02 +02:00
|
|
|
"2. \"outputs\" (string, required) a json object with outputs\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" {\n"
|
2021-01-20 19:21:53 +01:00
|
|
|
" \"address\": x.xxx (numeric or string, required) The key is the bitcoin address, the numeric value (can be string) is the BCH amount\n"
|
2015-06-29 20:14:02 +02:00
|
|
|
" \"data\": \"hex\", (string, required) The key is \"data\", the value is hex encoded data\n"
|
|
|
|
|
" ...\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" }\n"
|
2015-03-22 10:51:43 -07:00
|
|
|
"3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs\n"
|
2016-08-24 20:56:49 +02:00
|
|
|
"4. txversion (numeric, optional, default=1) Specifies the transaction format version\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
"\nResult:\n"
|
|
|
|
|
"\"transaction\" (string) hex string of the transaction\n"
|
|
|
|
|
|
|
|
|
|
"\nExamples\n"
|
|
|
|
|
+ HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"address\\\":0.01}\"")
|
2015-06-29 20:14:02 +02:00
|
|
|
+ HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"data\\\":\\\"00010203\\\"}\"")
|
2013-10-29 22:29:44 +11:00
|
|
|
+ HelpExampleRpc("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"")
|
2015-06-29 20:14:02 +02:00
|
|
|
+ HelpExampleRpc("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"data\\\":\\\"00010203\\\"}\"")
|
2013-10-29 22:29:44 +11:00
|
|
|
);
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2014-10-19 04:46:17 -04:00
|
|
|
LOCK(cs_main);
|
2015-03-22 10:51:43 -07:00
|
|
|
RPCTypeCheck(params, boost::assign::list_of(UniValue::VARR)(UniValue::VOBJ)(UniValue::VNUM), true);
|
|
|
|
|
if (params[0].isNull() || params[1].isNull())
|
|
|
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, arguments 1 and 2 must be non-null");
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-05-13 21:29:19 +02:00
|
|
|
UniValue inputs = params[0].get_array();
|
|
|
|
|
UniValue sendTo = params[1].get_obj();
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2014-06-07 13:53:27 +02:00
|
|
|
CMutableTransaction rawTx;
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-03-22 10:51:43 -07:00
|
|
|
if (params.size() > 2 && !params[2].isNull()) {
|
|
|
|
|
int64_t nLockTime = params[2].get_int64();
|
|
|
|
|
if (nLockTime < 0 || nLockTime > std::numeric_limits<uint32_t>::max())
|
|
|
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, locktime out of range");
|
|
|
|
|
rawTx.nLockTime = nLockTime;
|
2016-08-24 20:56:49 +02:00
|
|
|
}
|
|
|
|
|
if (params.size() > 3 && !params[3].isNull()) {
|
|
|
|
|
int version = params[3].get_int();
|
|
|
|
|
if (version != 1 && version != 4)
|
|
|
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, txversion can only be 1 or 4");
|
|
|
|
|
rawTx.nVersion = version;
|
2015-03-22 10:51:43 -07:00
|
|
|
}
|
|
|
|
|
|
2014-08-20 15:15:16 -04:00
|
|
|
for (unsigned int idx = 0; idx < inputs.size(); idx++) {
|
2015-05-18 14:02:18 +02:00
|
|
|
const UniValue& input = inputs[idx];
|
|
|
|
|
const UniValue& o = input.get_obj();
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2012-09-07 20:54:27 -04:00
|
|
|
uint256 txid = ParseHashO(o, "txid");
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
const UniValue& vout_v = find_value(o, "vout");
|
2014-08-20 15:15:16 -04:00
|
|
|
if (!vout_v.isNum())
|
2012-10-04 09:34:44 +02:00
|
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key");
|
2012-05-31 16:01:16 -04:00
|
|
|
int nOutput = vout_v.get_int();
|
|
|
|
|
if (nOutput < 0)
|
2012-10-04 09:34:44 +02:00
|
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout must be positive");
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-03-22 10:51:43 -07:00
|
|
|
uint32_t nSequence = (rawTx.nLockTime ? std::numeric_limits<uint32_t>::max() - 1 : std::numeric_limits<uint32_t>::max());
|
|
|
|
|
CTxIn in(COutPoint(txid, nOutput), CScript(), nSequence);
|
|
|
|
|
|
2012-05-31 16:01:16 -04:00
|
|
|
rawTx.vin.push_back(in);
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-02 19:53:22 +05:30
|
|
|
std::set<CBitcoinAddress> setAddress;
|
|
|
|
|
std::vector<std::string> addrList = sendTo.getKeys();
|
|
|
|
|
BOOST_FOREACH(const std::string& name_, addrList) {
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-06-29 20:14:02 +02:00
|
|
|
if (name_ == "data") {
|
|
|
|
|
std::vector<unsigned char> data = ParseHexV(sendTo[name_].getValStr(),"Data");
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-06-29 20:14:02 +02:00
|
|
|
CTxOut out(0, CScript() << OP_RETURN << data);
|
|
|
|
|
rawTx.vout.push_back(out);
|
|
|
|
|
} else {
|
|
|
|
|
CBitcoinAddress address(name_);
|
|
|
|
|
if (!address.IsValid())
|
2017-08-02 19:53:22 +05:30
|
|
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string("Invalid Bitcoin address: ")+name_);
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-06-29 20:14:02 +02:00
|
|
|
if (setAddress.count(address))
|
2017-08-02 19:53:22 +05:30
|
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, std::string("Invalid parameter, duplicated address: ")+name_);
|
2015-06-29 20:14:02 +02:00
|
|
|
setAddress.insert(address);
|
|
|
|
|
|
|
|
|
|
CScript scriptPubKey = GetScriptForDestination(address.Get());
|
2021-01-20 19:21:53 +01:00
|
|
|
int64_t nAmount = AmountFromValue(sendTo[name_]);
|
2015-06-29 20:14:02 +02:00
|
|
|
|
|
|
|
|
CTxOut out(nAmount, scriptPubKey);
|
|
|
|
|
rawTx.vout.push_back(out);
|
|
|
|
|
}
|
2012-05-31 16:01:16 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-23 23:10:24 -04:00
|
|
|
return EncodeHexTx(rawTx);
|
2012-05-31 16:01:16 -04:00
|
|
|
}
|
|
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
UniValue decoderawtransaction(const UniValue& params, bool fHelp)
|
2012-05-31 16:01:16 -04:00
|
|
|
{
|
|
|
|
|
if (fHelp || params.size() != 1)
|
2017-08-02 19:53:22 +05:30
|
|
|
throw std::runtime_error(
|
2013-10-29 22:29:44 +11:00
|
|
|
"decoderawtransaction \"hexstring\"\n"
|
|
|
|
|
"\nReturn a JSON object representing the serialized, hex-encoded transaction.\n"
|
|
|
|
|
|
|
|
|
|
"\nArguments:\n"
|
2014-04-29 14:34:41 -04:00
|
|
|
"1. \"hex\" (string, required) The transaction hex string\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
|
|
|
|
|
"\nResult:\n"
|
|
|
|
|
"{\n"
|
2014-04-29 14:34:41 -04:00
|
|
|
" \"txid\" : \"id\", (string) The transaction id\n"
|
2015-11-21 05:35:11 +03:00
|
|
|
" \"size\" : n, (numeric) The transaction size\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" \"version\" : n, (numeric) The version\n"
|
|
|
|
|
" \"locktime\" : ttt, (numeric) The lock time\n"
|
|
|
|
|
" \"vin\" : [ (array of json objects)\n"
|
|
|
|
|
" {\n"
|
|
|
|
|
" \"txid\": \"id\", (string) The transaction id\n"
|
|
|
|
|
" \"vout\": n, (numeric) The output number\n"
|
|
|
|
|
" \"scriptSig\": { (json object) The script\n"
|
|
|
|
|
" \"asm\": \"asm\", (string) asm\n"
|
|
|
|
|
" \"hex\": \"hex\" (string) hex\n"
|
|
|
|
|
" },\n"
|
|
|
|
|
" \"sequence\": n (numeric) The script sequence number\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" ,...\n"
|
|
|
|
|
" ],\n"
|
|
|
|
|
" \"vout\" : [ (array of json objects)\n"
|
|
|
|
|
" {\n"
|
2021-01-20 19:21:53 +01:00
|
|
|
" \"value\" : x.xxx, (numeric) The value in BCH\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
" \"n\" : n, (numeric) index\n"
|
|
|
|
|
" \"scriptPubKey\" : { (json object)\n"
|
|
|
|
|
" \"asm\" : \"asm\", (string) the asm\n"
|
|
|
|
|
" \"hex\" : \"hex\", (string) the hex\n"
|
|
|
|
|
" \"reqSigs\" : n, (numeric) The required sigs\n"
|
|
|
|
|
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
|
|
|
|
|
" \"addresses\" : [ (json array of string)\n"
|
|
|
|
|
" \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) bitcoin address\n"
|
|
|
|
|
" ,...\n"
|
|
|
|
|
" ]\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" ,...\n"
|
|
|
|
|
" ],\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
|
|
|
|
|
"\nExamples:\n"
|
|
|
|
|
+ HelpExampleCli("decoderawtransaction", "\"hexstring\"")
|
|
|
|
|
+ HelpExampleRpc("decoderawtransaction", "\"hexstring\"")
|
|
|
|
|
);
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2014-10-19 04:46:17 -04:00
|
|
|
LOCK(cs_main);
|
2014-08-20 15:15:16 -04:00
|
|
|
RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR));
|
2014-06-23 23:10:24 -04:00
|
|
|
|
2012-05-31 16:01:16 -04:00
|
|
|
CTransaction tx;
|
2014-06-23 23:10:24 -04:00
|
|
|
|
|
|
|
|
if (!DecodeHexTx(tx, params[0].get_str()))
|
2012-10-04 09:34:44 +02:00
|
|
|
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2015-05-10 13:35:44 +02:00
|
|
|
UniValue result(UniValue::VOBJ);
|
2014-12-15 09:11:16 +01:00
|
|
|
TxToJSON(tx, uint256(), result);
|
2012-05-31 16:01:16 -04:00
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
UniValue decodescript(const UniValue& params, bool fHelp)
|
2013-07-15 01:22:10 -04:00
|
|
|
{
|
|
|
|
|
if (fHelp || params.size() != 1)
|
2017-08-02 19:53:22 +05:30
|
|
|
throw std::runtime_error(
|
2013-10-29 22:29:44 +11:00
|
|
|
"decodescript \"hex\"\n"
|
|
|
|
|
"\nDecode a hex-encoded script.\n"
|
|
|
|
|
"\nArguments:\n"
|
|
|
|
|
"1. \"hex\" (string) the hex encoded script\n"
|
|
|
|
|
"\nResult:\n"
|
|
|
|
|
"{\n"
|
|
|
|
|
" \"asm\":\"asm\", (string) Script public key\n"
|
|
|
|
|
" \"hex\":\"hex\", (string) hex encoded public key\n"
|
|
|
|
|
" \"type\":\"type\", (string) The output type\n"
|
|
|
|
|
" \"reqSigs\": n, (numeric) The required signatures\n"
|
|
|
|
|
" \"addresses\": [ (json array of string)\n"
|
|
|
|
|
" \"address\" (string) bitcoin address\n"
|
|
|
|
|
" ,...\n"
|
|
|
|
|
" ],\n"
|
|
|
|
|
" \"p2sh\",\"address\" (string) script address\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"\nExamples:\n"
|
|
|
|
|
+ HelpExampleCli("decodescript", "\"hexstring\"")
|
|
|
|
|
+ HelpExampleRpc("decodescript", "\"hexstring\"")
|
|
|
|
|
);
|
2013-07-15 01:22:10 -04:00
|
|
|
|
2015-05-10 13:35:44 +02:00
|
|
|
RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR));
|
2013-07-15 01:22:10 -04:00
|
|
|
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue r(UniValue::VOBJ);
|
2013-07-15 01:22:10 -04:00
|
|
|
CScript script;
|
|
|
|
|
if (params[0].get_str().size() > 0){
|
2017-08-02 19:53:22 +05:30
|
|
|
std::vector<unsigned char> scriptData(ParseHexV(params[0], "argument"));
|
2013-07-15 01:22:10 -04:00
|
|
|
script = CScript(scriptData.begin(), scriptData.end());
|
|
|
|
|
} else {
|
|
|
|
|
// Empty scripts are valid
|
|
|
|
|
}
|
|
|
|
|
ScriptPubKeyToJSON(script, r, false);
|
|
|
|
|
|
2014-09-24 22:24:46 -04:00
|
|
|
r.push_back(Pair("p2sh", CBitcoinAddress(CScriptID(script)).ToString()));
|
2013-07-15 01:22:10 -04:00
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-22 19:07:28 +01:00
|
|
|
/** Pushes a JSON object for script verification or signing errors to vErrorsRet. */
|
2015-05-18 14:02:18 +02:00
|
|
|
static void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std::string& strMessage)
|
2015-03-22 19:07:28 +01:00
|
|
|
{
|
2015-05-10 14:48:35 +02:00
|
|
|
UniValue entry(UniValue::VOBJ);
|
2015-03-22 19:07:28 +01:00
|
|
|
entry.push_back(Pair("txid", txin.prevout.hash.ToString()));
|
|
|
|
|
entry.push_back(Pair("vout", (uint64_t)txin.prevout.n));
|
|
|
|
|
entry.push_back(Pair("scriptSig", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
|
|
|
|
|
entry.push_back(Pair("sequence", (uint64_t)txin.nSequence));
|
|
|
|
|
entry.push_back(Pair("error", strMessage));
|
|
|
|
|
vErrorsRet.push_back(entry);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 14:02:18 +02:00
|
|
|
UniValue sendrawtransaction(const UniValue& params, bool fHelp)
|
2012-05-31 16:01:16 -04:00
|
|
|
{
|
2013-08-28 15:41:46 -07:00
|
|
|
if (fHelp || params.size() < 1 || params.size() > 2)
|
2017-08-02 19:53:22 +05:30
|
|
|
throw std::runtime_error(
|
2013-10-29 22:29:44 +11:00
|
|
|
"sendrawtransaction \"hexstring\" ( allowhighfees )\n"
|
|
|
|
|
"\nSubmits raw transaction (serialized, hex-encoded) to local node and network.\n"
|
2026-05-05 00:39:16 +02:00
|
|
|
"\nAlso see createrawtransaction call.\n"
|
2013-10-29 22:29:44 +11:00
|
|
|
"\nArguments:\n"
|
|
|
|
|
"1. \"hexstring\" (string, required) The hex string of the raw transaction)\n"
|
|
|
|
|
"2. allowhighfees (boolean, optional, default=false) Allow high fees\n"
|
|
|
|
|
"\nResult:\n"
|
|
|
|
|
"\"hex\" (string) The transaction hash in hex\n"
|
|
|
|
|
"\nExamples:\n"
|
|
|
|
|
"\nCreate a transaction\n"
|
|
|
|
|
+ HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") +
|
|
|
|
|
"\nSend the transaction (signed hex)\n"
|
|
|
|
|
+ HelpExampleCli("sendrawtransaction", "\"signedhex\"") +
|
|
|
|
|
"\nAs a json rpc call\n"
|
|
|
|
|
+ HelpExampleRpc("sendrawtransaction", "\"signedhex\"")
|
|
|
|
|
);
|
|
|
|
|
|
2018-01-15 15:26:12 +00:00
|
|
|
std::future<std::string> future;
|
|
|
|
|
uint256 hashTx;
|
|
|
|
|
{
|
2014-10-19 04:46:17 -04:00
|
|
|
LOCK(cs_main);
|
2014-08-20 15:15:16 -04:00
|
|
|
RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)(UniValue::VBOOL));
|
2012-05-31 16:01:16 -04:00
|
|
|
|
|
|
|
|
// parse hex string from parameter
|
|
|
|
|
CTransaction tx;
|
2014-06-23 23:10:24 -04:00
|
|
|
if (!DecodeHexTx(tx, params[0].get_str()))
|
|
|
|
|
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
2018-01-15 15:26:12 +00:00
|
|
|
hashTx = tx.GetHash();
|
2012-05-31 16:01:16 -04:00
|
|
|
|
2013-08-28 15:41:46 -07:00
|
|
|
bool fOverrideFees = false;
|
|
|
|
|
if (params.size() > 1)
|
|
|
|
|
fOverrideFees = params[1].get_bool();
|
|
|
|
|
|
2018-07-23 18:05:43 +02:00
|
|
|
auto utxo = g_utxo->find(hashTx, 0);
|
2014-02-22 12:02:42 +01:00
|
|
|
bool fHaveMempool = mempool.exists(hashTx);
|
2018-07-23 18:05:43 +02:00
|
|
|
bool fHaveChain = utxo.isValid() && utxo.blockHeight() < 1000000000;
|
2014-02-22 12:02:42 +01:00
|
|
|
if (!fHaveMempool && !fHaveChain) {
|
|
|
|
|
// push to local node and sync with wallets
|
2021-03-04 15:48:56 +01:00
|
|
|
uint32_t flags = 0;
|
2018-01-15 15:26:12 +00:00
|
|
|
if (!fOverrideFees)
|
|
|
|
|
flags |= Validation::RejectAbsurdFeeTx;
|
|
|
|
|
|
|
|
|
|
future = Application::instance()->validation()->addTransaction(Tx::fromOldTransaction(tx), flags);
|
2014-02-22 12:02:42 +01:00
|
|
|
} else if (fHaveChain) {
|
|
|
|
|
throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain");
|
2012-07-12 19:46:24 -04:00
|
|
|
}
|
2018-01-15 15:26:12 +00:00
|
|
|
}
|
|
|
|
|
if (future.valid()) {
|
|
|
|
|
const std::string result = future.get();
|
|
|
|
|
if (!result.empty()) {
|
2018-01-25 09:33:19 +00:00
|
|
|
if (result == "16: missing-inputs")
|
|
|
|
|
throw JSONRPCError(RPC_TRANSACTION_ERROR, result);
|
2018-01-15 15:26:12 +00:00
|
|
|
throw JSONRPCError(RPC_TRANSACTION_REJECTED, result);
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-12 19:46:24 -04:00
|
|
|
return hashTx.GetHex();
|
2012-05-31 16:01:16 -04:00
|
|
|
}
|