65 throw std::runtime_error(
66 "gethexaddress \"address\"\n" 68 "\nConverts a base58 pubkeyhash address to a hex address for use in smart contracts.\n" 71 "1. \"address\" (string, required) The base58 address\n" 74 "\"hexaddress\" (string) The raw hex pubkeyhash address for use in smart contracts\n" 88 return boost::get<CKeyID>(
address.Get()).GetReverseHex();
93 throw std::runtime_error(
94 "fromhexaddress \"hexaddress\"\n" 96 "\nConverts a raw hex address to a base58 pubkeyhash address\n" 99 "1. \"hexaddress\" (string, required) The raw hex address\n" 102 "\"address\" (string) The base58 pubkeyhash address\n" 120 throw std::runtime_error(
121 "getrawtransaction \"txid\" ( verbose )\n" 123 "\nNOTE: By default this function only works for mempool transactions. If the -txindex option is\n" 124 "enabled, it also works for blockchain transactions.\n" 125 "DEPRECATED: for now, it also works for transactions with unspent outputs.\n" 127 "\nReturn the raw transaction data.\n" 128 "\nIf verbose is 'true', returns an Object with information about 'txid'.\n" 129 "If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n" 132 "1. \"txid\" (string, required) The transaction id\n" 133 "2. verbose (bool, optional, default=false) If false, return a string, otherwise return a json object\n" 135 "\nResult (if verbose is not set or set to false):\n" 136 "\"data\" (string) The serialized, hex-encoded data for 'txid'\n" 138 "\nResult (if verbose is set to true):\n" 140 " \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n" 141 " \"txid\" : \"id\", (string) The transaction id (same as provided)\n" 142 " \"hash\" : \"id\", (string) The transaction hash (differs from txid for witness transactions)\n" 143 " \"size\" : n, (numeric) The serialized transaction size\n" 144 " \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n" 145 " \"version\" : n, (numeric) The version\n" 146 " \"locktime\" : ttt, (numeric) The lock time\n" 147 " \"vin\" : [ (array of json objects)\n" 149 " \"txid\": \"id\", (string) The transaction id\n" 150 " \"vout\": n, (numeric) \n" 151 " \"scriptSig\": { (json object) The script\n" 152 " \"asm\": \"asm\", (string) asm\n" 153 " \"hex\": \"hex\" (string) hex\n" 155 " \"sequence\": n (numeric) The script sequence number\n" 156 " \"txinwitness\": [\"hex\", ...] (array of string) hex-encoded witness data (if any)\n" 160 " \"vout\" : [ (array of json objects)\n" 162 " \"value\" : x.xxx, (numeric) The value in " +
CURRENCY_UNIT +
"\n" 163 " \"n\" : n, (numeric) index\n" 164 " \"scriptPubKey\" : { (json object)\n" 165 " \"asm\" : \"asm\", (string) the asm\n" 166 " \"hex\" : \"hex\", (string) the hex\n" 167 " \"reqSigs\" : n, (numeric) The required sigs\n" 168 " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" 169 " \"addresses\" : [ (json array of string)\n" 170 " \"address\" (string) fabcoin address\n" 177 " \"blockhash\" : \"hash\", (string) the block hash\n" 178 " \"confirmations\" : n, (numeric) The confirmations\n" 179 " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n" 180 " \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n" 194 bool fVerbose =
false;
215 :
"No such mempool transaction. Use -txindex to enable blockchain transaction queries") +
216 ". Use gettransaction for wallet transactions.");
229 throw std::runtime_error(
230 "gettxoutproof [\"txid\",...] ( blockhash )\n" 231 "\nReturns a hex-encoded proof that \"txid\" was included in a block.\n" 232 "\nNOTE: By default this function only works sometimes. This is when there is an\n" 233 "unspent output in the utxo for this transaction. To make it always work,\n" 234 "you need to maintain a transaction index, using the -txindex command line option or\n" 235 "specify the block in which the transaction is included manually (by blockhash).\n" 237 "1. \"txids\" (string) A json array of txids to filter\n" 239 " \"txid\" (string) A transaction hash\n" 242 "2. \"blockhash\" (string, optional) If specified, looks for txid in the block with this hash\n" 244 "\"data\" (string) A string that is a serialized, hex-encoded data for the proof.\n" 247 std::set<uint256> setTxids;
250 for (
unsigned int idx = 0; idx < txids.
size(); idx++) {
255 if (setTxids.count(hash))
257 setTxids.insert(hash);
274 for (
const auto& tx : setTxids) {
283 if (pblockindex ==
nullptr)
297 unsigned int ntxFound = 0;
298 for (
const auto& tx : block.
vtx)
299 if (setTxids.count(tx->GetHash()))
301 if (ntxFound != setTxids.size())
314 throw std::runtime_error(
315 "verifytxoutproof \"proof\"\n" 316 "\nVerifies that a proof points to a transaction in a block, returning the transaction it commits to\n" 317 "and throwing an RPC error if the block is not in our best chain\n" 319 "1. \"proof\" (string, required) The hex-encoded proof generated by gettxoutproof\n" 321 "[\"txid\"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid\n" 330 std::vector<uint256> vMatch;
331 std::vector<unsigned int> vIndex;
332 if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) != merkleBlock.header.hashMerkleRoot)
340 for (
const uint256& hash : vMatch)
348 throw std::runtime_error(
349 "createrawtransaction [{\"txid\":\"id\",\"vout\":n},...] {\"address\":amount,\"data\":\"hex\",...} ( locktime ) ( replaceable )\n" 350 "\nCreate a transaction spending the given inputs and creating new outputs.\n" 351 "Outputs can be addresses or data.\n" 352 "Returns hex-encoded raw transaction.\n" 353 "Note that the transaction's inputs are not signed, and\n" 354 "it is not stored in the wallet or transmitted to the network.\n" 357 "1. \"inputs\" (array, required) A json array of json objects\n" 360 " \"txid\":\"id\", (string, required) The transaction id\n" 361 " \"vout\":n, (numeric, required) The output number\n" 362 " \"sequence\":n (numeric, optional) The sequence number\n" 366 "2. \"outputs\" (object, required) a json object with outputs\n" 368 " \"address\": x.xxx, (numeric or string, required) The key is the fabcoin address, the numeric value (can be string) is the " +
CURRENCY_UNIT +
" amount\n" 369 " \"data\": \"hex\" (string, required) The key is \"data\", the value is hex encoded data\n" 371 " \"contractAddress\":\"address\", (string, required) Valid contract address (valid hash160 hex data)\n" 372 " \"data\":\"hex\", (string, required) Hex data to add in the call output\n" 373 " \"amount\":x.xxx, (numeric, optional) Value in fasc to send with the call, should be a valid amount, default 0\n" 374 " \"gasLimit\":x, (numeric, optional) The gas limit for the transaction\n" 375 " \"gasPrice\":x.xxx (numeric, optional) The gas price for the transaction\n" 379 "3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs\n" 380 "4. replaceable (boolean, optional, default=false) Marks this transaction as BIP125 replaceable.\n" 381 " Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.\n" 383 "\"transaction\" (string) hex string of the transaction\n" 386 +
HelpExampleCli(
"createrawtransaction",
"\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"address\\\":0.01}\"")
387 +
HelpExampleCli(
"createrawtransaction",
"\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"data\\\":\\\"00010203\\\"}\"")
388 +
HelpExampleCli(
"createrawtransaction",
"\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"contract\\\":{\\\"contractAddress\\\":\\\"mycontract\\\"," 389 "\\\"data\\\":\\\"00\\\", \\\"gasLimit\\\":250000, \\\"gasPrice\\\":0.00000040, \\\"amount\\\":0}}\"")
390 +
HelpExampleRpc(
"createrawtransaction",
"\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"")
391 +
HelpExampleRpc(
"createrawtransaction",
"\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"data\\\":\\\"00010203\\\"}\"")
392 +
HelpExampleRpc(
"createrawtransaction",
"\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"contract\\\":{\\\"contractAddress\\\":\\\"mycontract\\\"," 393 "\\\"data\\\":\\\"00\\\", \\\"gasLimit\\\":250000, \\\"gasPrice\\\":0.00000040, \\\"amount\\\":0}}\"")
415 for (
unsigned int idx = 0; idx < inputs.
size(); idx++) {
416 const UniValue& input = inputs[idx];
424 int nOutput = vout_v.
get_int();
430 nSequence = MAX_BIP125_RBF_SEQUENCE;
439 if (sequenceObj.
isNum()) {
440 int64_t seqNr64 = sequenceObj.
get_int64();
444 nSequence = (uint32_t)seqNr64;
450 rawTx.
vin.push_back(in);
453 std::set<CFabcoinAddress> setAddress;
454 std::vector<std::string> addrList = sendTo.
getKeys();
455 for (
const std::string& name_ : addrList) {
457 if (name_ ==
"data") {
458 std::vector<unsigned char>
data =
ParseHexV(sendTo[name_].getValStr(),
"Data");
461 rawTx.
vout.push_back(out);
462 }
else if (name_ ==
"contract") {
476 CAmount nGasPrice = (minGasPrice>DEFAULT_GAS_PRICE)?minGasPrice:DEFAULT_GAS_PRICE;
479 if(!Contract.
exists(
"contractAddress") || !Contract[
"contractAddress"].
isStr())
482 std::string contractaddress = Contract[
"contractAddress"].
get_str();
483 if(contractaddress.size() != 40 || !
CheckHex(contractaddress))
491 if(!Contract.
exists(
"data") || !Contract[
"data"].
isStr())
494 std::string datahex = Contract[
"data"].
get_str();
495 if(datahex.size() % 2 != 0 || !
CheckHex(datahex))
500 if (Contract.
exists(
"amount")){
507 uint64_t nGasLimit=DEFAULT_GAS_LIMIT_OP_SEND;
508 if (Contract.
exists(
"gasLimit")){
509 nGasLimit = Contract[
"gasLimit"].
get_int64();
510 if (nGasLimit > blockGasLimit)
512 if (nGasLimit < MINIMUM_GAS_LIMIT)
519 if (Contract.
exists(
"gasPrice")){
520 UniValue uGasPrice = Contract[
"gasPrice"];
526 if (nGasPrice > (int64_t)maxRpcGasPrice)
528 if (nGasPrice < (int64_t)minGasPrice)
536 CTxOut out(nAmount, scriptPubKey);
537 rawTx.
vout.push_back(out);
543 if (setAddress.count(address))
545 setAddress.insert(address);
550 CTxOut out(nAmount, scriptPubKey);
551 rawTx.
vout.push_back(out);
565 throw std::runtime_error(
566 "decoderawtransaction \"hexstring\"\n" 567 "\nReturn a JSON object representing the serialized, hex-encoded transaction.\n" 570 "1. \"hexstring\" (string, required) The transaction hex string\n" 574 " \"txid\" : \"id\", (string) The transaction id\n" 575 " \"hash\" : \"id\", (string) The transaction hash (differs from txid for witness transactions)\n" 576 " \"size\" : n, (numeric) The transaction size\n" 577 " \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n" 578 " \"version\" : n, (numeric) The version\n" 579 " \"locktime\" : ttt, (numeric) The lock time\n" 580 " \"vin\" : [ (array of json objects)\n" 582 " \"txid\": \"id\", (string) The transaction id\n" 583 " \"vout\": n, (numeric) The output number\n" 584 " \"scriptSig\": { (json object) The script\n" 585 " \"asm\": \"asm\", (string) asm\n" 586 " \"hex\": \"hex\" (string) hex\n" 588 " \"txinwitness\": [\"hex\", ...] (array of string) hex-encoded witness data (if any)\n" 589 " \"sequence\": n (numeric) The script sequence number\n" 593 " \"vout\" : [ (array of json objects)\n" 595 " \"value\" : x.xxx, (numeric) The value in " +
CURRENCY_UNIT +
"\n" 596 " \"n\" : n, (numeric) index\n" 597 " \"scriptPubKey\" : { (json object)\n" 598 " \"asm\" : \"asm\", (string) the asm\n" 599 " \"hex\" : \"hex\", (string) the hex\n" 600 " \"reqSigs\" : n, (numeric) The required sigs\n" 601 " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" 602 " \"addresses\" : [ (json array of string)\n" 603 " \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) fabcoin address\n" 634 throw std::runtime_error(
635 "getcontractaddress \"hexstring\"\n" 636 "\nReturn the expected contract address of a transaction.\n" 639 "1. \"hexstring\" (string, required) The transaction hex string\n" 642 "\"address\" (string) The fabcoin address of the contract.\n" 657 std::vector<unsigned char> SHA256TxVout(32);
658 std::vector<unsigned char> contractAddress(20);
668 txIdAndVout.resize(32);
669 uint32_t voutNumber = 0;
670 bool txHasOpCreate =
false;
671 for (
auto txout : mtx.
vout) {
672 if (txout.scriptPubKey.HasOpCreate()) {
673 std::vector<unsigned char> voutNumberChrs;
674 if (voutNumberChrs.size() <
sizeof(voutNumber))
675 voutNumberChrs.resize(
sizeof(voutNumber));
676 std::memcpy(voutNumberChrs.data(), &voutNumber,
sizeof(voutNumber));
677 txIdAndVout.insert(txIdAndVout.end(), voutNumberChrs.begin(), voutNumberChrs.end());
678 txHasOpCreate =
true;
687 CSHA256().
Write(txIdAndVout.data(), txIdAndVout.size()).Finalize(SHA256TxVout.data());
688 CRIPEMD160().
Write(SHA256TxVout.data(), SHA256TxVout.size()).Finalize(contractAddress.data());
699 throw std::runtime_error(
700 "decodescript \"hexstring\"\n" 701 "\nDecode a hex-encoded script.\n" 703 "1. \"hexstring\" (string) the hex encoded script\n" 706 " \"asm\":\"asm\", (string) Script public key\n" 707 " \"hex\":\"hex\", (string) hex encoded public key\n" 708 " \"type\":\"type\", (string) The output type\n" 709 " \"reqSigs\": n, (numeric) The required signatures\n" 710 " \"addresses\": [ (json array of string)\n" 711 " \"address\" (string) fabcoin address\n" 714 " \"p2sh\",\"address\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n" 726 std::vector<unsigned char> scriptData(
ParseHexV(request.
params[0],
"argument"));
727 script =
CScript(scriptData.begin(), scriptData.end());
746 static void TxInErrorToJSON(
const CTxIn& txin,
UniValue& vErrorsRet,
const std::string& strMessage)
766 throw std::runtime_error(
767 "combinerawtransaction [\"hexstring\",...]\n" 768 "\nCombine multiple partially signed transactions into one transaction.\n" 769 "The combined transaction may be another partially signed transaction or a \n" 770 "fully signed transaction." 773 "1. \"txs\" (string) A json array of hex strings of partially signed transactions\n" 775 " \"hexstring\" (string) A transaction hash\n" 780 "\"hex\" (string) The hex-encoded raw transaction with signature(s)\n" 783 +
HelpExampleCli(
"combinerawtransaction",
"[\"myhex1\", \"myhex2\", \"myhex3\"]")
788 std::vector<CMutableTransaction> txVariants(txs.
size());
790 for (
unsigned int idx = 0; idx < txs.
size(); idx++) {
796 if (txVariants.empty()) {
814 for (
const CTxIn& txin : mergedTx.
vin) {
825 for (
unsigned int i = 0; i < mergedTx.
vin.size(); i++) {
838 if (txv.vin.size() > i) {
856 throw std::runtime_error(
857 "signrawtransaction \"hexstring\" ( [{\"txid\":\"id\",\"vout\":n,\"scriptPubKey\":\"hex\",\"redeemScript\":\"hex\"},...] [\"privatekey1\",...] sighashtype )\n" 858 "\nSign inputs for raw transaction (serialized, hex-encoded).\n" 859 "The second optional argument (may be null) is an array of previous transaction outputs that\n" 860 "this transaction depends on but may not yet be in the block chain.\n" 861 "The third optional argument (may be null) is an array of base58-encoded private\n" 862 "keys that, if given, will be the only keys used to sign the transaction.\n" 868 "1. \"hexstring\" (string, required) The transaction hex string\n" 869 "2. \"prevtxs\" (string, optional) An json array of previous dependent transaction outputs\n" 870 " [ (json array of json objects, or 'null' if none provided)\n" 872 " \"txid\":\"id\", (string, required) The transaction id\n" 873 " \"vout\":n, (numeric, required) The output number\n" 874 " \"scriptPubKey\": \"hex\", (string, required) script key\n" 875 " \"redeemScript\": \"hex\", (string, required for P2SH or P2WSH) redeem script\n" 876 " \"amount\": value (numeric, required) The amount spent\n" 880 "3. \"privkeys\" (string, optional) A json array of base58-encoded private keys for signing\n" 881 " [ (json array of strings, or 'null' if none provided)\n" 882 " \"privatekey\" (string) private key in base58-encoding\n" 885 "4. \"sighashtype\" (string, optional, default=ALL) The signature hash type. Must be one of\n" 889 " \"ALL|ANYONECANPAY\"\n" 890 " \"NONE|ANYONECANPAY\"\n" 891 " \"SINGLE|ANYONECANPAY\"\n" 895 " \"hex\" : \"value\", (string) The hex-encoded raw transaction with signature(s)\n" 896 " \"complete\" : true|false, (boolean) If the transaction has a complete set of signatures\n" 897 " \"errors\" : [ (json array of objects) Script verification errors (if there are any)\n" 899 " \"txid\" : \"hash\", (string) The hash of the referenced, previous transaction\n" 900 " \"vout\" : n, (numeric) The index of the output to spent and used as input\n" 901 " \"scriptSig\" : \"hex\", (string) The hex-encoded signature script\n" 902 " \"sequence\" : n, (numeric) Script sequence number\n" 903 " \"error\" : \"text\" (string) Verification or signing error related to the input\n" 919 RPCTypeCheck(request.
params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR},
true);
941 bool fGivenKeys =
false;
946 for (
unsigned int idx = 0; idx < keys.
size(); idx++) {
967 for (
unsigned int idx = 0; idx < prevTxs.
size(); idx++) {
983 int nOut =
find_value(prevOut,
"vout").get_int();
988 std::vector<unsigned char> pkData(
ParseHexO(prevOut,
"scriptPubKey"));
989 CScript scriptPubKey(pkData.begin(), pkData.end());
994 std::string err(
"Previous output scriptPubKey mismatch:\n");
1002 if (prevOut.
exists(
"amount")) {
1006 view.
AddCoin(out, std::move(newcoin),
true);
1011 if (fGivenKeys && (scriptPubKey.IsPayToScriptHash() || scriptPubKey.IsPayToWitnessScriptHash())) {
1021 std::vector<unsigned char> rsData(
ParseHexV(v,
"redeemScript"));
1022 CScript redeemScript(rsData.begin(), rsData.end());
1029 #ifdef ENABLE_WALLET 1030 const CKeyStore& keystore = ((fGivenKeys || !pwallet) ? tempKeystore : *pwallet);
1032 const CKeyStore& keystore = tempKeystore;
1037 static std::map<std::string, int> mapSigHashValues = {
1046 if (mapSigHashValues.count(strHashType))
1047 nHashType = mapSigHashValues[strHashType];
1061 for (
unsigned int i = 0; i < mtx.
vin.size(); i++) {
1065 TxInErrorToJSON(txin, vErrors,
"Input not found or already spent");
1073 if (!fHashSingle || (i < mtx.
vout.size()))
1084 bool fComplete = vErrors.
empty();
1089 if (!vErrors.
empty()) {
1099 throw std::runtime_error(
1100 "sendrawtransaction \"hexstring\" ( allowhighfees )\n" 1101 "\nSubmits raw transaction (serialized, hex-encoded) to local node and network.\n" 1102 "\nAlso see createrawtransaction and signrawtransaction calls.\n" 1104 "1. \"hexstring\" (string, required) The hex string of the raw transaction)\n" 1105 "2. allowhighfees (boolean, optional, default=false) Allow high fees\n" 1107 "\"hex\" (string) The transaction hash in hex\n" 1109 "\nCreate a transaction\n" 1110 +
HelpExampleCli(
"createrawtransaction",
"\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") +
1111 "Sign the transaction, and get back the hex\n" 1113 "\nSend the transaction (signed hex)\n" 1115 "\nAs a json rpc call\n" 1127 const uint256& hashTx = tx->GetHash();
1134 bool fHaveChain =
false;
1135 for (
size_t o = 0; !fHaveChain && o < tx->vout.size(); o++) {
1137 fHaveChain = !existingCoin.
IsSpent();
1140 if (!fHaveMempool && !fHaveChain) {
1143 bool fMissingInputs;
1144 bool fLimitFree =
true;
1145 if (!
AcceptToMemoryPool(
mempool, state, std::move(tx), fLimitFree, &fMissingInputs,
nullptr,
false, nMaxRawTxFee,
true)) {
1149 if (fMissingInputs) {
1155 }
else if (fHaveChain) {
1172 {
"rawtransactions",
"getrawtransaction", &
getrawtransaction,
true, {
"txid",
"verbose"} },
1173 {
"rawtransactions",
"createrawtransaction", &
createrawtransaction,
true, {
"inputs",
"outputs",
"locktime",
"replaceable"} },
1175 {
"rawtransactions",
"getcontractaddress", &
getcontractaddress,
true, {
"hexstring"} },
1176 {
"rawtransactions",
"decodescript", &
decodescript,
true, {
"hexstring"} },
1177 {
"rawtransactions",
"sendrawtransaction", &
sendrawtransaction,
false, {
"hexstring",
"allowhighfees"} },
1179 {
"rawtransactions",
"signrawtransaction", &
signrawtransaction,
false, {
"hexstring",
"prevtxs",
"privkeys",
"sighashtype"} },
1180 {
"rawtransactions",
"gethexaddress", &
gethexaddress,
true, {
"address",} },
1181 {
"rawtransactions",
"fromhexaddress", &
fromhexaddress,
true, {
"hexaddress",} },
1183 {
"blockchain",
"gettxoutproof", &
gettxoutproof,
true, {
"txids",
"blockhash"} },
1189 for (
unsigned int vcidx = 0; vcidx <
ARRAYLEN(commands); vcidx++)
A base58-encoded secret key.
const Coin & AccessByTxid(const CCoinsViewCache &view, const uint256 &txid)
Utility function to find any unspent output with a given txid.
const std::string CURRENCY_UNIT
void RPCTypeCheckObj(const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull, bool fStrict)
CSHA256 & Write(const unsigned char *data, size_t len)
Aliases for backward compatibility.
uint256 ParseHashO(const UniValue &o, std::string strKey)
std::vector< unsigned char > ParseHexO(const UniValue &o, std::string strKey)
void UpdateTransaction(CMutableTransaction &tx, unsigned int nIn, const SignatureData &data)
const std::string & get_str() const
bool SetString(const char *pszSecret)
SignatureData DataFromTransaction(const CMutableTransaction &tx, unsigned int nIn)
Extract signature data from a transaction, and insert it.
void AddCoin(const COutPoint &outpoint, Coin &&coin, bool potential_overwrite)
Add a coin.
UniValue combinerawtransaction(const JSONRPCRequest &request)
Fabcoin RPC command dispatcher.
enum ScriptError_t ScriptError
const_iterator begin() const
void SetBackend(CCoinsView &viewIn)
UniValue gethexaddress(const JSONRPCRequest &request)
CCriticalSection cs_wallet
CAmount maxTxFee
Absolute maximum transaction fee (in liu) used by wallet and mempool (rejects high fee in sendrawtran...
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror)
CScriptWitness scriptWitness
std::string GetHex() const
static VersionVM GetEVMDefault()
const Consensus::Params & GetConsensus() const
base58-encoded Fabcoin addresses.
CTxOut out
unspent transaction output
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
virtual bool AddCScript(const CScript &redeemScript) override
Support for BIP 0013 : see https://github.com/fabcoin/bips/blob/master/bip-0013.mediawiki.
std::vector< std::vector< unsigned char > > stack
UniValue decoderawtransaction(const JSONRPCRequest &request)
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
Double ended buffer combining vector and stream-like interfaces.
UniValue getcontractaddress(const JSONRPCRequest &request)
void TxToJSON(const CTransaction &tx, const uint256 hashBlock, UniValue &entry)
std::shared_ptr< const CTransaction > CTransactionRef
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
bool ProduceSignature(const BaseSignatureCreator &creator, const CScript &fromPubKey, SignatureData &sigdata)
Produce a script signature using a generic signature creator.
void PushInventory(const CInv &inv)
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull)
Type-check arguments; throws JSONRPCError if wrong type given.
Invalid, missing or duplicate parameter.
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded Values (throws error if not hex).
SignatureData CombineSignatures(const CScript &scriptPubKey, const BaseSignatureChecker &checker, const SignatureData &scriptSig1, const SignatureData &scriptSig2)
Combine two script signatures using a generic signature checker, intelligently, possibly with OP_0 pl...
std::string ToString() const
bool IsValid() const
Check whether this private key is valid.
const char * ScriptErrorString(const ScriptError serror)
int64_t CAmount
Amount in lius (Can be negative)
bool ReadBlockFromDisk(Block &block, const CDiskBlockPos &pos, const Consensus::Params &consensusParams)
Functions for disk access for blocks.
General error during transaction or block submission.
uint32_t nHeight
at which height this containing transaction was included in the active block chain ...
CCoinsViewCache * pcoinsTip
Global variable that points to the active CCoinsView (protected by cs_main)
int Height() const
Return the maximal height in the chain.
Used to relay blocks as header + vector<merkle branch> to filtered nodes.
int64_t get_int64() const
bool push_back(const UniValue &val)
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
Create the assembly string representation of a CScript object.
Abstract view on the open txout dataset.
An input of a transaction.
void SetReverseHex(const char *psz)
bool DecodeHexTx(CMutableTransaction &tx, const std::string &strHexTx, bool fTryNoWitness=false)
const Object_type::value_type::Value_type & find_value(const Object_type &obj, const String_type &name)
uint64_t getBlockGasLimit(unsigned int blockHeight)
uint256 uint256S(const char *str)
UniValue fromhexaddress(const JSONRPCRequest &request)
uint32_t ContractHeight
Block height at which Fabcoin Smart Contract hard fork becomes active.
UniValue decodescript(const JSONRPCRequest &request)
bool IsHex(const std::string &str)
Unexpected type was passed as parameter.
const Coin & AccessCoin(const COutPoint &output) const
Return a reference to Coin in the cache, or a pruned one if not found.
Fixed-size raw-byte array container type, with an API optimised for storing hashes.
std::string ToString() const
bool ParseMoney(const std::string &str, CAmount &nRet)
An output of a transaction.
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
CScript GetScriptForDestination(const CTxDestination &dest)
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
std::string HelpRequiringPassphrase()
CAmount AmountFromValue(const UniValue &value)
An outpoint - a combination of a transaction hash and an index n into its vout.
virtual bool AddKey(const CKey &key)
std::vector< CTxOut > vout
CTxDestination Get() const
std::string FormatMoney(const CAmount &n)
Money parsing/formatting utilities.
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
void RegisterRawTransactionRPCCommands(CRPCTable &t)
Register raw transaction RPC commands.
bool AcceptToMemoryPool(CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, std::list< CTransactionRef > *plTxnReplaced, bool fOverrideMempoolLimit, const CAmount nAbsurdFee, bool rawTx)
(try to) add transaction to memory pool plTxnReplaced will be appended to with all transactions repla...
std::vector< unsigned char > ParseHexV(const UniValue &v, std::string strName)
CRIPEMD160 & Write(const unsigned char *data, size_t len)
bool exists(uint256 hash) const
bool CheckHex(const std::string &str)
std::string GetRejectReason() const
unsigned int GetRejectCode() const
UniValue createrawtransaction(const JSONRPCRequest &request)
Capture information about block/transaction validation.
std::vector< CTransactionRef > vtx
bool GetTransaction(const uint256 &hash, CTransactionRef &txOut, const Consensus::Params &consensusParams, uint256 &hashBlock, bool fAllowSlow)
Return transaction in txOut, and if it was found inside a block, its hash is placed in hashBlock...
const std::string & getValStr() const
const UniValue & get_array() const
PlatformStyle::TableColorType type
UniValue getrawtransaction(const JSONRPCRequest &request)
UniValue verifytxoutproof(const JSONRPCRequest &request)
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
UniValue sendrawtransaction(const JSONRPCRequest &request)
Serialized script, used inside transaction inputs and outputs.
int RPCSerializationFlags()
void * memcpy(void *a, const void *b, size_t c)
bool SignalsOptInRBF(const CTransaction &tx)
A virtual base class for key stores.
A reference to a CKey: the Hash160 of its serialized public key.
bool Contains(const CBlockIndex *pindex) const
Efficiently check whether a block is present in this chain.
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
UniValue gettxoutproof(const JSONRPCRequest &request)
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
std::unique_ptr< CConnman > g_connman
CWallet * GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
std::string i64tostr(int64_t n)
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
A reference to a CScript: the Hash160 of its serialization (see script.h)
A mutable version of CTransaction.
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0)
UniValue signrawtransaction(const JSONRPCRequest &request)
UniValue JSONRPCError(int code, const std::string &message)
No valid connection manager instance found.
bool exists(const std::string &key) const
struct evm_uint160be address(struct evm_env *env)
An encapsulated private key.
The basic transaction that is broadcasted on the network and contained in blocks. ...
int nHeight
height of the entry in the chain. The genesis block has height 0
const std::vector< std::string > & getKeys() const
Information about a peer.
CCoinsView that adds a memory cache for transactions to another CCoinsView.
int64_t GetBlockTime() const
A hasher class for SHA-256.
std::string get_str(std::string::const_iterator begin, std::string::const_iterator end)
const UniValue & get_obj() const
CCoinsView that brings transactions from a memorypool into view.
Basic key store, that keeps keys in an address->secret map.
Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type.
std::unique_ptr< FascState > globalState
Global state.
Error parsing or validating structure in raw format.
A hasher class for RIPEMD-160.
const_iterator end() const
void EnsureWalletIsUnlocked()
std::vector< unsigned char > ParseHex(const char *psz)