34 #include <boost/assign/list_of.hpp> 35 #include <boost/optional.hpp> 39 static const std::string WALLET_ENDPOINT_BASE =
"/wallet/";
43 if (request.
URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) {
45 std::string requestedWallet =
urlDecode(request.
URI.substr(WALLET_ENDPOINT_BASE.size()));
47 if (pwallet->GetName() == requestedWallet) {
58 return pwallet && pwallet->
IsCrypted() ?
"\nRequires wallet passphrase to be set with walletpassphrase call." :
"";
63 if (pwallet)
return true;
64 if (avoidException)
return false;
72 RPC_METHOD_NOT_FOUND,
"Method not found (wallet method is disabled because no wallet is loaded)");
75 "Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).");
108 std::string rbfStatus =
"no";
113 rbfStatus =
"unknown";
119 for (
const std::pair<std::string, std::string>& item : wtx.
mapValue)
125 std::string strAccount = value.
get_str();
126 if (strAccount ==
"*")
139 throw std::runtime_error(
140 "getnewaddress ( \"account\" )\n" 141 "\nReturns a new Fabcoin address for receiving payments.\n" 142 "If 'account' is specified (DEPRECATED), it is added to the address book \n" 143 "so payments received with the address will be credited to 'account'.\n" 145 "1. \"account\" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.\n" 147 "\"address\" (string) The new fabcoin address\n" 154 std::string strAccount;
193 throw std::runtime_error(
194 "getaccountaddress \"account\"\n" 195 "\nDEPRECATED. Returns the current Fabcoin address for receiving payments to this account.\n" 197 "1. \"account\" (string, required) The account name for the address. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.\n" 199 "\"address\" (string) The account fabcoin address\n" 223 throw std::runtime_error(
224 "getrawchangeaddress\n" 225 "\nReturns a new Fabcoin address, for receiving change.\n" 226 "This is for use with raw transactions, NOT normal use.\n" 228 "\"address\" (string) The address\n" 259 throw std::runtime_error(
260 "setaccount \"address\" \"account\"\n" 261 "\nDEPRECATED. Sets the account associated with the given address.\n" 263 "1. \"address\" (string, required) The fabcoin address to be associated with an account.\n" 264 "2. \"account\" (string, required) The account to assign the address to.\n" 266 HelpExampleCli(
"setaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"tabby\"") +
HelpExampleRpc(
"setaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"tabby\""));
274 std::string strAccount;
303 throw std::runtime_error(
304 "getaccount \"address\"\n" 305 "\nDEPRECATED. Returns the account associated with the given address.\n" 307 "1. \"address\" (string, required) The fabcoin address for account lookup.\n" 309 "\"accountname\" (string) the account address\n" 311 HelpExampleCli(
"getaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"") +
HelpExampleRpc(
"getaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\""));
319 std::string strAccount;
320 std::map<CTxDestination, CAddressBookData>::iterator mi = pwallet->
mapAddressBook.find(
address.Get());
321 if (mi != pwallet->
mapAddressBook.end() && !(*mi).second.name.empty()) {
322 strAccount = (*mi).second.name;
336 throw std::runtime_error(
337 "getaddressesbyaccount \"account\"\n" 338 "\nDEPRECATED. Returns the list of addresses for the given account.\n" 340 "1. \"account\" (string, required) The account name.\n" 342 "[ (json array of string)\n" 343 " \"address\" (string) a fabcoin address associated with the given account\n" 355 for (
const std::pair<CFabcoinAddress, CAddressBookData>& item : pwallet->
mapAddressBook) {
357 const std::string& strName = item.second.name;
358 if (strName == strAccount)
372 if (nValue > curBalance)
385 std::string strError;
386 std::vector<CRecipient> vecSend;
387 int nChangePosRet = -1;
388 CRecipient recipient = {scriptPubKey, nValue, fSubtractFeeFromAmount};
390 if (!pwallet->
CreateTransaction(vecSend, wtxNew, reservekey, nFeeRequired, nChangePosRet, strError, coin_control,
true, 0, hasSender)) {
391 if (!fSubtractFeeFromAmount && nValue + nFeeRequired > curBalance)
392 strError =
strprintf(
"Error: This transaction requires a transaction fee of at least %s",
FormatMoney(nFeeRequired));
410 throw std::runtime_error(
411 "sendtoaddress \"address\" amount ( \"comment\" \"comment_to\" subtractfeefromamount replaceable conf_target \"estimate_mode\")\n" 412 "\nSend an amount to a given address.\n" +
415 "1. \"address\" (string, required) The fabcoin address to send to.\n" 416 "2. \"amount\" (numeric or string, required) The amount in " +
418 "3. \"comment\" (string, optional) A comment used to store what the transaction is for. \n" 419 " This is not part of the transaction, just kept in your wallet.\n" 420 "4. \"comment_to\" (string, optional) A comment to store the name of the person or organization \n" 421 " to which you're sending the transaction. This is not part of the \n" 422 " transaction, just kept in your wallet.\n" 423 "5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.\n" 424 " The recipient will receive less fabcoins than you enter in the amount field.\n" 425 "6. replaceable (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees via BIP 125\n" 426 "7. conf_target (numeric, optional) Confirmation target (in blocks)\n" 427 "8. \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n" 430 " \"CONSERVATIVE\"\n" 431 "9. \"senderaddress\" (string, optional) The quantum address that will be used to send money from.\n" 432 "10.\"changeToSender\" (bool, optional, default=false) Return the change to the sender.\n" 434 "\"txid\" (string) The transaction id.\n" 436 HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1") +
HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"") +
HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true") +
HelpExampleRpc(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\""));
456 bool fSubtractFeeFromAmount =
false;
477 bool fHasSender =
false;
487 bool fChangeToSender =
false;
496 std::vector<COutput> vecOutputs;
503 for (
const COutput& out : vecOutputs) {
505 const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;
510 if (!fValidAddress || senderAddress.
Get() != destAdress.
Get())
521 if (fChangeToSender) {
528 SendMoney(pwallet,
address.Get(), nAmount, fSubtractFeeFromAmount, wtx, coin_control, fHasSender);
530 return wtx.GetHash().GetHex();
553 throw std::runtime_error(
554 "getvmaddress \"address\" \n" 556 "1. \"address\" (string, required) The account address\n");
559 std::vector<unsigned char> contractAddress(20);
571 throw std::runtime_error(
572 "getfabaddressbyvm \"vmaddress\" \n" 574 "1. \"vmaddress\" (string, required) The VM account address\n");
577 if (strAddr.size() != 40 || !
CheckHex(strAddr) )
583 fabAddress.
Set(keyid);
604 uint64_t blockGasLimit = fascDGP.getBlockGasLimit(height);
605 uint64_t minGasPrice =
CAmount(fascDGP.getMinGasPrice(height));
606 CAmount nGasPrice = (minGasPrice > DEFAULT_GAS_PRICE) ? minGasPrice : DEFAULT_GAS_PRICE;
610 "createcontract \"bytecode\" (gaslimit gasprice \"senderaddress\" broadcast)" 611 "\nCreate a contract with bytcode.\n" +
614 "1. \"bytecode\" (string, required) contract bytecode.\n" 615 "2. gasLimit (numeric or string, optional) gasLimit, default: " +
616 i64tostr(DEFAULT_GAS_LIMIT_OP_CREATE) +
", max: " +
i64tostr(blockGasLimit) +
"\n" 617 "3. gasPrice (numeric or string, optional) gasPrice FASC price per gas unit, default: " +
619 "4. \"senderaddress\" (string, optional) The quantum address that will be used to create the contract.\n" 620 "5. \"broadcast\" (bool, optional, default=true) Whether to broadcast the transaction or not.\n" 621 "6. \"changeToSender\" (bool, optional, default=true) Return the change to the sender.\n" 625 " \"txid\" : (string) The transaction id.\n" 626 " \"sender\" : (string) " +
628 " \"hash160\" : (string) ripemd-160 hash of the sender.\n" 629 " \"address\" : (string) expected contract address.\n" 633 HelpExampleCli(
"createcontract",
"\"60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690836c010000000000000000000000009081020402179055506103786001600050819055505b600c80605b6000396000f360606040526008565b600256\"") +
HelpExampleCli(
"createcontract",
"\"60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690836c010000000000000000000000009081020402179055506103786001600050819055505b600c80605b6000396000f360606040526008565b600256\" 6000000 " +
FormatMoney(minGasPrice) +
" \"QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" true"));
654 if(bytecode.size() % 2 != 0 || !
CheckHex(bytecode))
657 uint64_t nGasLimit = DEFAULT_GAS_LIMIT_OP_CREATE;
660 if (nGasLimit > blockGasLimit)
662 if (nGasLimit < MINIMUM_GAS_LIMIT)
673 if (nGasPrice > (int64_t)maxRpcGasPrice)
675 if (nGasPrice < (int64_t)minGasPrice)
679 bool fHasSender =
false;
689 bool fBroadcast =
true;
694 bool fChangeToSender =
true;
705 std::vector<COutput> vecOutputs;
712 for (
const COutput out : vecOutputs) {
714 const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;
719 if (!fValidAddress || senderAddress.
Get() != destAdress.
Get() )
734 if (fChangeToSender) {
744 CAmount nGasFee = nGasPrice * nGasLimit;
752 if (nGasFee > curBalance)
761 std::string strError;
762 std::vector<CRecipient> vecSend;
763 int nChangePosRet = -1;
764 CRecipient recipient = {scriptPubKey, 0,
false};
767 if (!pwallet->
CreateTransaction(vecSend, wtx, reservekey, nFeeRequired, nChangePosRet, strError, coinControl,
true, nGasFee, fHasSender)) {
769 strError =
strprintf(
"Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!",
FormatMoney(nFeeRequired));
777 if (fHasSender && !(senderAddress.
Get() == txSenderDest)) {
779 LogPrintf(
"Debug createcontract fHasSender=%d, senderAddress=%s, txSenderDest=%s \n", fHasSender, senderAddress.
ToString(), txd.
ToString() );
787 throw JSONRPCError(
RPC_WALLET_ERROR,
"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of the wallet and coins were spent in the copy but not marked as spent here.");
799 std::vector<unsigned char> SHA256TxVout(32);
800 std::vector<unsigned char> contractAddress(20);
802 uint32_t voutNumber = 0;
803 for (
const CTxOut& txout : wtx.
tx->vout) {
805 std::vector<unsigned char> voutNumberChrs;
806 if (voutNumberChrs.size() <
sizeof(voutNumber)) voutNumberChrs.resize(
sizeof(voutNumber));
807 std::memcpy(voutNumberChrs.data(), &voutNumber,
sizeof(voutNumber));
808 txIdAndVout.insert(txIdAndVout.end(), voutNumberChrs.begin(), voutNumberChrs.end());
813 CSHA256().
Write(txIdAndVout.data(), txIdAndVout.size()).Finalize(SHA256TxVout.data());
814 CRIPEMD160().
Write(SHA256TxVout.data(), SHA256TxVout.size()).Finalize(contractAddress.data());
833 CAmount nGasPrice = (minGasPrice > DEFAULT_GAS_PRICE) ? minGasPrice : DEFAULT_GAS_PRICE;
837 "sendtocontract \"contractaddress\" \"data\" (amount gaslimit gasprice senderaddress broadcast)" 838 "\nSend funds and data to a contract.\n" +
841 "1. \"contractaddress\" (string, required) The contract address that will receive the funds and data.\n" 842 "2. \"datahex\" (string, required) data to send.\n" 843 "3. \"amount\" (numeric or string, optional) The amount in " +
845 "4. gasLimit (numeric or string, optional) gasLimit, default: " +
846 i64tostr(DEFAULT_GAS_LIMIT_OP_SEND) +
", max: " +
i64tostr(blockGasLimit) +
"\n" 847 "5. gasPrice (numeric or string, optional) gasPrice Fasc price per gas unit, default: " +
849 "6. \"senderaddress\" (string, optional) The quantum address that will be used as sender.\n" 850 "7. \"broadcast\" (bool, optional, default=true) Whether to broadcast the transaction or not.\n" 851 "8. \"changeToSender\" (bool, optional, default=true) Return the change to the sender.\n" 855 " \"txid\" : (string) The transaction id.\n" 856 " \"sender\" : (string) " +
858 " \"hash160\" : (string) ripemd-160 hash of the sender.\n" 862 HelpExampleCli(
"sendtocontract",
"\"c6ca2697719d00446d4ea51f6fac8fd1e9310214\" \"54f6127f\"") +
HelpExampleCli(
"sendtocontract",
"\"c6ca2697719d00446d4ea51f6fac8fd1e9310214\" \"54f6127f\" 12.0015 6000000 " +
FormatMoney(minGasPrice) +
" \"QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\""));
868 if (contractaddress.size() != 40 || !
CheckHex(contractaddress))
876 if (datahex.size() % 2 != 0 || !
CheckHex(datahex))
886 uint64_t nGasLimit = DEFAULT_GAS_LIMIT_OP_SEND;
889 if (nGasLimit > blockGasLimit)
891 if (nGasLimit < MINIMUM_GAS_LIMIT)
902 if (nGasPrice > (int64_t)maxRpcGasPrice)
904 if (nGasPrice < (int64_t)minGasPrice)
908 bool fHasSender =
false;
918 bool fBroadcast =
true;
923 bool fChangeToSender =
true;
934 std::vector<COutput> vecOutputs;
941 for (
auto out : vecOutputs) {
943 const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;
948 if (!fValidAddress || senderAddress.
Get() != destAdress.
Get())
963 if (fChangeToSender) {
974 CAmount nGasFee = nGasPrice * nGasLimit;
982 if (nAmount + nGasFee > curBalance)
991 std::string strError;
992 std::vector<CRecipient> vecSend;
993 int nChangePosRet = -1;
994 CRecipient recipient = {scriptPubKey, nAmount,
false};
997 if (!pwallet->
CreateTransaction(vecSend, wtx, reservekey, nFeeRequired, nChangePosRet, strError, coinControl,
true, nGasFee, fHasSender)) {
999 strError =
strprintf(
"Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!",
FormatMoney(nFeeRequired));
1007 if (fHasSender && !(senderAddress.
Get() == txSenderDest)) {
1009 LogPrintf(
"Debug sendtocontract fHasSender=%d, senderAddress=%s, txSenderDest=%s \n", fHasSender, senderAddress.
ToString(), txd.
ToString() );
1019 throw JSONRPCError(
RPC_WALLET_ERROR,
"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of the wallet and coins were spent in the copy but not marked as spent here.");
1045 throw std::runtime_error(
1046 "listaddressgroupings\n" 1047 "\nLists groups of addresses which have had their common ownership\n" 1048 "made public by common use as inputs or as the resulting change\n" 1049 "in past transactions\n" 1054 " \"address\", (string) The fabcoin address\n" 1055 " amount, (numeric) The amount in " +
1057 " \"account\" (string, optional) DEPRECATED. The account\n" 1085 return jsonGroupings;
1096 throw std::runtime_error(
1097 "signmessage \"address\" \"message\"\n" 1098 "\nSign a message with the private key of an address" +
1101 "1. \"address\" (string, required) The fabcoin address to use for the private key.\n" 1102 "2. \"message\" (string, required) The message to create a signature of.\n" 1104 "\"signature\" (string) The signature of the message encoded in base 64\n" 1106 "\nUnlock the wallet for 30 seconds\n" +
1108 "\nCreate the signature\n" +
HelpExampleCli(
"signmessage",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"") +
1109 "\nVerify the signature\n" +
HelpExampleCli(
"verifymessage",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"") +
1110 "\nAs json rpc\n" +
HelpExampleRpc(
"signmessage",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"my message\""));
1128 if (!pwallet->
GetKey(keyID, key)) {
1136 std::vector<unsigned char> vchSig;
1151 throw std::runtime_error(
1152 "getreceivedbyaddress \"address\" ( minconf )\n" 1153 "\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\n" 1155 "1. \"address\" (string, required) The fabcoin address for transactions.\n" 1156 "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" 1158 "amount (numeric) The total amount in " +
1161 "\nThe amount from transactions with at least 1 confirmation\n" +
1162 HelpExampleCli(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"") +
1163 "\nThe amount including unconfirmed transactions, zero confirmations\n" +
HelpExampleCli(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 0") +
1164 "\nThe amount with at least 6 confirmations\n" +
HelpExampleCli(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 6") +
1165 "\nAs a json rpc call\n" +
HelpExampleRpc(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", 6"));
1174 if (!
IsMine(*pwallet, scriptPubKey)) {
1185 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
1190 for (
const CTxOut& txout : wtx.
tx->vout)
1208 throw std::runtime_error(
1209 "getreceivedbyaccount \"account\" ( minconf )\n" 1210 "\nDEPRECATED. Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.\n" 1212 "1. \"account\" (string, required) The selected account, may be the default account using \"\".\n" 1213 "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" 1215 "amount (numeric) The total amount in " +
1218 "\nAmount received by the default account with at least 1 confirmation\n" +
1220 "\nAmount received at the tabby account including unconfirmed amounts with zero confirmations\n" +
HelpExampleCli(
"getreceivedbyaccount",
"\"tabby\" 0") +
1221 "\nThe amount with at least 6 confirmations\n" +
HelpExampleCli(
"getreceivedbyaccount",
"\"tabby\" 6") +
1222 "\nAs a json rpc call\n" +
HelpExampleRpc(
"getreceivedbyaccount",
"\"tabby\", 6"));
1237 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
1242 for (
const CTxOut& txout : wtx.
tx->vout) {
1263 throw std::runtime_error(
1264 "getbalance ( \"account\" minconf include_watchonly )\n" 1265 "\nIf account is not specified, returns the server's total available balance.\n" 1266 "If account is specified (DEPRECATED), returns the balance in the account.\n" 1267 "Note that the account \"\" is not the same as leaving the parameter out.\n" 1268 "The server total may be different to the balance in the default \"\" account.\n" 1270 "1. \"account\" (string, optional) DEPRECATED. The account string may be given as a\n" 1271 " specific account name to find the balance associated with wallet keys in\n" 1272 " a named account, or as the empty string (\"\") to find the balance\n" 1273 " associated with wallet keys not in any named account, or as \"*\" to find\n" 1274 " the balance associated with all wallet keys regardless of account.\n" 1275 " When this option is specified, it calculates the balance in a different\n" 1276 " way than when it is not specified, and which can count spends twice when\n" 1277 " there are conflicting pending transactions (such as those created by\n" 1278 " the bumpfee command), temporarily resulting in low or even negative\n" 1279 " balances. In general, account balance calculation is not considered\n" 1280 " reliable and has resulted in confusing outcomes, so it is recommended to\n" 1281 " avoid passing this argument.\n" 1282 "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" 1283 "3. include_watchonly (bool, optional, default=false) Also include balance in watch-only addresses (see 'importaddress')\n" 1285 "amount (numeric) The total amount in " +
1288 "\nThe total amount in the wallet with 1 or more confirmations\n" +
1290 "\nThe total amount in the wallet at least 6 blocks confirmed\n" +
HelpExampleCli(
"getbalance",
"\"*\" 6") +
1291 "\nAs a json rpc call\n" +
HelpExampleRpc(
"getbalance",
"\"*\", 6"));
1298 const std::string& account_param = request.
params[0].
get_str();
1299 const std::string* account = account_param !=
"*" ? &account_param :
nullptr;
1320 throw std::runtime_error(
1321 "getunconfirmedbalance\n" 1322 "Returns the server's total unconfirmed balance\n");
1338 throw std::runtime_error(
1339 "move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n" 1340 "\nDEPRECATED. Move a specified amount from one account in your wallet to another.\n" 1342 "1. \"fromaccount\" (string, required) The name of the account to move funds from. May be the default account using \"\".\n" 1343 "2. \"toaccount\" (string, required) The name of the account to move funds to. May be the default account using \"\".\n" 1344 "3. amount (numeric) Quantity of " +
1346 "4. (dummy) (numeric, optional) Ignored. Remains for backward compatibility.\n" 1347 "5. \"comment\" (string, optional) An optional comment, stored in the wallet only.\n" 1349 "true|false (boolean) true if successful.\n" 1353 "\nMove 0.01 " +
CURRENCY_UNIT +
" timotei to akiko with a comment and funds have 6 confirmations\n" +
HelpExampleCli(
"move",
"\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") +
1354 "\nAs a json rpc call\n" +
HelpExampleRpc(
"move",
"\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\""));
1366 std::string strComment;
1370 if (!pwallet->
AccountMove(strFrom, strTo, nAmount, strComment)) {
1386 throw std::runtime_error(
1387 "sendfrom \"fromaccount\" \"toaddress\" amount ( minconf \"comment\" \"comment_to\" )\n" 1388 "\nDEPRECATED (use sendtoaddress). Sent an amount from an account to a fabcoin address." +
1391 "1. \"fromaccount\" (string, required) The name of the account to send funds from. May be the default account using \"\".\n" 1392 " Specifying an account does not influence coin selection, but it does associate the newly created\n" 1393 " transaction with the account, so the account's balance computation and transaction history can reflect\n" 1395 "2. \"toaddress\" (string, required) The fabcoin address to send funds to.\n" 1396 "3. amount (numeric or string, required) The amount in " +
1398 "4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n" 1399 "5. \"comment\" (string, optional) A comment used to store what the transaction is for. \n" 1400 " This is not part of the transaction, just kept in your wallet.\n" 1401 "6. \"comment_to\" (string, optional) An optional comment to store the name of the person or organization \n" 1402 " to which you're sending the transaction. This is not part of the transaction, \n" 1403 " it is just kept in your wallet.\n" 1405 "\"txid\" (string) The transaction id.\n" 1408 CURRENCY_UNIT +
" from the default account to the address, must have at least 1 confirmation\n" +
HelpExampleCli(
"sendfrom",
"\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") +
1409 "\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\n" +
HelpExampleCli(
"sendfrom",
"\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"") +
1410 "\nAs a json rpc call\n" +
HelpExampleRpc(
"sendfrom",
"\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\""));
1436 if (nAmount > nBalance)
1440 SendMoney(pwallet,
address.Get(), nAmount,
false, wtx, no_coin_control,
false);
1442 return wtx.GetHash().GetHex();
1454 throw std::runtime_error(
1455 "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] replaceable conf_target \"estimate_mode\")\n" 1456 "\nSend multiple times. Amounts are double-precision floating point numbers." +
1459 "1. \"fromaccount\" (string, required) DEPRECATED. The account to send the funds from. Should be \"\" for the default account\n" 1460 "2. \"amounts\" (string, required) A json object with addresses and amounts\n" 1462 " \"address\":amount (numeric or string) The fabcoin address is the key, the numeric amount (can be string) in " +
1466 "3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n" 1467 "4. \"comment\" (string, optional) A comment\n" 1468 "5. subtractfeefrom (array, optional) A json array with addresses.\n" 1469 " The fee will be equally deducted from the amount of each selected address.\n" 1470 " Those recipients will receive less fabcoins than you enter in their corresponding amount field.\n" 1471 " If no addresses are specified here, the sender pays the fee.\n" 1473 " \"address\" (string) Subtract fee from this address\n" 1476 "6. replaceable (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees via BIP 125\n" 1477 "7. conf_target (numeric, optional) Confirmation target (in blocks)\n" 1478 "8. \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n" 1481 " \"CONSERVATIVE\"\n" 1483 "\"txid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n" 1484 " the number of addresses.\n" 1486 "\nSend two amounts to two different addresses:\n" +
1487 HelpExampleCli(
"sendmany",
"\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"") +
1488 "\nSend two amounts to two different addresses setting the confirmation and comment:\n" +
HelpExampleCli(
"sendmany",
"\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 6 \"testing\"") +
1489 "\nSend two amounts to two different addresses, subtract fee from amount:\n" +
HelpExampleCli(
"sendmany",
"\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 1 \"\" \"[\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\",\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"") +
1490 "\nAs a json rpc call\n" +
HelpExampleRpc(
"sendmany",
"\"\", \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\", 6, \"testing\""));
1528 std::set<CFabcoinAddress> setAddress;
1529 std::vector<CRecipient> vecSend;
1532 std::vector<std::string> keys = sendTo.
getKeys();
1533 for (
const std::string& name_ : keys) {
1538 if (setAddress.count(address))
1540 setAddress.insert(address);
1546 totalAmount += nAmount;
1548 bool fSubtractFeeFromAmount =
false;
1549 for (
unsigned int idx = 0; idx < subtractFeeFromAmount.
size(); idx++) {
1550 const UniValue& addr = subtractFeeFromAmount[idx];
1552 fSubtractFeeFromAmount =
true;
1555 CRecipient recipient = {scriptPubKey, nAmount, fSubtractFeeFromAmount};
1563 if (totalAmount > nBalance)
1569 int nChangePosRet = -1;
1570 std::string strFailReason;
1571 bool fCreated = pwallet->
CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, nChangePosRet, strFailReason, coin_control);
1594 std::string msg =
"addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n" 1595 "\nAdd a nrequired-to-sign multisignature address to the wallet.\n" 1596 "Each key is a Fabcoin address or hex-encoded public key.\n" 1597 "If 'account' is specified (DEPRECATED), assign address to that account.\n" 1600 "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n" 1601 "2. \"keys\" (string, required) A json array of fabcoin addresses or hex-encoded public keys\n" 1603 " \"address\" (string) fabcoin address or hex-encoded public key\n" 1606 "3. \"account\" (string, optional) DEPRECATED. An account to assign the addresses to.\n" 1609 "\"address\" (string) A fabcoin address associated with the keys.\n" 1612 "\nAdd a multisig address from 2 addresses\n" +
1613 HelpExampleCli(
"addmultisigaddress",
"2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
1614 "\nAs json rpc call\n" +
HelpExampleRpc(
"addmultisigaddress",
"2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"");
1615 throw std::runtime_error(msg);
1620 std::string strAccount;
1669 if (pwallet && pwallet->
GetCScript(scriptID, subscript)) {
1671 std::vector<unsigned char> witprog;
1701 std::string msg =
"addwitnessaddress \"address\"\n" 1702 "\nAdd a witness address for a script (with pubkey or redeemscript known).\n" 1703 "It returns the witness script.\n" 1706 "1. \"address\" (string, required) An address known to the wallet\n" 1709 "\"witnessaddress\", (string) The value of the new address (P2SH of witness script).\n" 1711 throw std::runtime_error(msg);
1727 bool ret = boost::apply_visitor(w, dest);
1745 throw std::runtime_error(
1746 "getnewwitnessaddress ( \"account\" )\n" 1747 "\nReturns a new Fabcoin address for receiving payments.\n" 1748 "If 'account' is specified (DEPRECATED), it is added to the address book \n" 1749 "so payments received with the address will be credited to 'account'.\n" 1751 "1. \"account\" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.\n" 1753 "\"address\" (string) The new fabcoin address\n" 1762 std::string strAccount;
1779 bool ret = boost::apply_visitor(w, dest);
1797 fIsWatchonly =
false;
1805 if (!params[0].isNull())
1806 nMinDepth = params[0].
get_int();
1809 bool fIncludeEmpty =
false;
1810 if (!params[1].isNull())
1811 fIncludeEmpty = params[1].
get_bool();
1814 if (!params[2].isNull())
1815 if (params[2].get_bool())
1819 std::map<CFabcoinAddress, tallyitem> mapTally;
1820 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
1827 if (nDepth < nMinDepth)
1830 for (
const CTxOut& txout : wtx.
tx->vout) {
1836 if (!(mine & filter))
1850 std::map<std::string, tallyitem> mapAccountTally;
1851 for (
const std::pair<CFabcoinAddress, CAddressBookData>& item : pwallet->
mapAddressBook) {
1853 const std::string& strAccount = item.second.name;
1854 std::map<CFabcoinAddress, tallyitem>::iterator it = mapTally.find(address);
1855 if (it == mapTally.end() && !fIncludeEmpty)
1860 bool fIsWatchonly =
false;
1861 if (it != mapTally.end()) {
1862 nAmount = (*it).second.nAmount;
1863 nConf = (*it).second.nConf;
1864 fIsWatchonly = (*it).second.fIsWatchonly;
1868 tallyitem& _item = mapAccountTally[strAccount];
1883 if (it != mapTally.end()) {
1884 for (
const uint256& _item : (*it).second.txids) {
1894 for (std::map<std::string, tallyitem>::iterator it = mapAccountTally.begin(); it != mapAccountTally.end(); ++it) {
1895 CAmount nAmount = (*it).second.nAmount;
1896 int nConf = (*it).second.nConf;
1898 if ((*it).second.fIsWatchonly)
1918 throw std::runtime_error(
1919 "listreceivedbyaddress ( minconf include_empty include_watchonly)\n" 1920 "\nList balances by receiving address.\n" 1922 "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" 1923 "2. include_empty (bool, optional, default=false) Whether to include addresses that haven't received any payments.\n" 1924 "3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\n" 1929 " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n" 1930 " \"address\" : \"receivingaddress\", (string) The receiving address\n" 1931 " \"account\" : \"accountname\", (string) DEPRECATED. The account of the receiving address. The default account is \"\".\n" 1932 " \"amount\" : x.xxx, (numeric) The total amount in " +
1934 " \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n" 1935 " \"label\" : \"label\", (string) A comment for the address/transaction, if any\n" 1937 " n, (numeric) The ids of transactions received with the address \n" 1960 throw std::runtime_error(
1961 "listreceivedbyaccount ( minconf include_empty include_watchonly)\n" 1962 "\nDEPRECATED. List balances by account.\n" 1964 "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" 1965 "2. include_empty (bool, optional, default=false) Whether to include accounts that haven't received any payments.\n" 1966 "3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\n" 1971 " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n" 1972 " \"account\" : \"accountname\", (string) The account name of the receiving account\n" 1973 " \"amount\" : x.xxx, (numeric) The total amount received by addresses with this account\n" 1974 " \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n" 1975 " \"label\" : \"label\" (string) A comment for the address/transaction, if any\n" 2009 std::string strSentAccount;
2010 std::list<COutputEntry> listReceived;
2011 std::list<COutputEntry> listSent;
2013 wtx.
GetAmounts(listReceived, listSent, nFee, strSentAccount, filter);
2015 bool fAllAccounts = (strAccount == std::string(
"*"));
2019 if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount)) {
2026 MaybePushAddress(entry, s.destination);
2044 std::string account;
2048 if (fAllAccounts || (account == strAccount)) {
2054 MaybePushAddress(entry, r.destination);
2080 bool fAllAccounts = (strAccount == std::string(
"*"));
2082 if (fAllAccounts || acentry.
strAccount == strAccount) {
2102 throw std::runtime_error(
2103 "listtransactions ( \"account\" count skip include_watchonly)\n" 2104 "\nReturns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.\n" 2106 "1. \"account\" (string, optional) DEPRECATED. The account name. Should be \"*\".\n" 2107 "2. count (numeric, optional, default=10) The number of transactions to return\n" 2108 "3. skip (numeric, optional, default=0) The number of transactions to skip\n" 2109 "4. include_watchonly (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\n" 2113 " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. \n" 2114 " It will be \"\" for the default account.\n" 2115 " \"address\":\"address\", (string) The fabcoin address of the transaction. Not present for \n" 2116 " move transactions (category = move).\n" 2117 " \"category\":\"send|receive|move\", (string) The transaction category. 'move' is a local (off blockchain)\n" 2118 " transaction between accounts, and not associated with an address,\n" 2119 " transaction id or block. 'send' and 'receive' transactions are \n" 2120 " associated with an address, transaction id and block details\n" 2121 " \"amount\": x.xxx, (numeric) The amount in " +
2122 CURRENCY_UNIT +
". This is negative for the 'send' category, and for the\n" 2123 " 'move' category for moves outbound. It is positive for the 'receive' category,\n" 2124 " and for the 'move' category for inbound funds.\n" 2125 " \"label\": \"label\", (string) A comment for the address/transaction, if any\n" 2126 " \"vout\": n, (numeric) the vout value\n" 2127 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
2128 CURRENCY_UNIT +
". This is negative and only available for the \n" 2129 " 'send' category of transactions.\n" 2130 " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n" 2131 " 'receive' category of transactions. Negative confirmations indicate the\n" 2132 " transaction conflicts with the block chain\n" 2133 " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n" 2134 " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive'\n" 2135 " category of transactions.\n" 2136 " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive'\n" 2137 " category of transactions.\n" 2138 " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 2139 " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" 2140 " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" 2141 " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n" 2142 " for 'send' and 'receive' category of transactions.\n" 2143 " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" 2144 " \"otheraccount\": \"accountname\", (string) DEPRECATED. For the 'move' category of transactions, the account the funds came \n" 2145 " from (for receiving funds, positive amounts), or went to (for sending funds,\n" 2146 " negative amounts).\n" 2147 " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 2148 " may be unknown for unconfirmed transactions not in the mempool\n" 2149 " \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n" 2150 " 'send' category of transactions.\n" 2155 "\nList the most recent 10 transactions in the systems\n" +
2157 "\nList transactions 100 to 120\n" +
HelpExampleCli(
"listtransactions",
"\"*\" 20 100") +
2158 "\nAs a json rpc call\n" +
HelpExampleRpc(
"listtransactions",
"\"*\", 20, 100"));
2162 std::string strAccount =
"*";
2186 for (CWallet::TxItems::const_reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it) {
2187 CWalletTx*
const pwtx = (*it).second.first;
2194 if ((
int)ret.
size() >= (nCount + nFrom))
break;
2198 if (nFrom > (
int)ret.
size())
2200 if ((nFrom + nCount) > (
int)ret.
size())
2201 nCount = ret.
size() - nFrom;
2203 std::vector<UniValue> arrTmp = ret.
getValues();
2205 std::vector<UniValue>::iterator first = arrTmp.begin();
2206 std::advance(first, nFrom);
2207 std::vector<UniValue>::iterator last = arrTmp.begin();
2208 std::advance(last, nFrom + nCount);
2210 if (last != arrTmp.end()) arrTmp.erase(last, arrTmp.end());
2211 if (first != arrTmp.begin()) arrTmp.erase(arrTmp.begin(), first);
2213 std::reverse(arrTmp.begin(), arrTmp.end());
2230 throw std::runtime_error(
2231 "listaccounts ( minconf include_watchonly)\n" 2232 "\nDEPRECATED. Returns Object that has account names as keys, account balances as values.\n" 2234 "1. minconf (numeric, optional, default=1) Only include transactions with at least this many confirmations\n" 2235 "2. include_watchonly (bool, optional, default=false) Include balances in watch-only addresses (see 'importaddress')\n" 2237 "{ (json object where keys are account names, and values are numeric balances\n" 2238 " \"account\": x.xxx, (numeric) The property name is the account name, and the value is the total balance for the account.\n" 2242 "\nList account balances where there at least 1 confirmation\n" +
2244 "\nList account balances including zero confirmation transactions\n" +
HelpExampleCli(
"listaccounts",
"0") +
2245 "\nList account balances for 6 or more confirmations\n" +
HelpExampleCli(
"listaccounts",
"6") +
2258 std::map<std::string, CAmount> mapAccountBalances;
2259 for (
const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->
mapAddressBook) {
2260 if (
IsMine(*pwallet, entry.first) & includeWatchonly) {
2261 mapAccountBalances[entry.second.name] = 0;
2265 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
2268 std::string strSentAccount;
2269 std::list<COutputEntry> listReceived;
2270 std::list<COutputEntry> listSent;
2274 wtx.
GetAmounts(listReceived, listSent, nFee, strSentAccount, includeWatchonly);
2275 mapAccountBalances[strSentAccount] -= nFee;
2277 mapAccountBalances[strSentAccount] -= s.amount;
2278 if (nDepth >= nMinDepth) {
2281 mapAccountBalances[pwallet->
mapAddressBook[r.destination].name] += r.amount;
2283 mapAccountBalances[
""] += r.amount;
2287 const std::list<CAccountingEntry>& acentries = pwallet->
laccentries;
2289 mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
2292 for (
const std::pair<std::string, CAmount>& accountBalance : mapAccountBalances) {
2306 throw std::runtime_error(
2307 "listsinceblock ( \"blockhash\" target_confirmations include_watchonly include_removed )\n" 2308 "\nGet all transactions in blocks since block [blockhash], or all transactions if omitted.\n" 2309 "If \"blockhash\" is no longer a part of the main chain, transactions from the fork point onward are included.\n" 2310 "Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n" 2312 "1. \"blockhash\" (string, optional) The block hash to list transactions since\n" 2313 "2. target_confirmations: (numeric, optional, default=1) Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value\n" 2314 "3. include_watchonly: (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\n" 2315 "4. include_removed: (bool, optional, default=true) Show transactions that were removed due to a reorg in the \"removed\" array\n" 2316 " (not guaranteed to work on pruned nodes)\n" 2319 " \"transactions\": [\n" 2320 " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. Will be \"\" for the default account.\n" 2321 " \"address\":\"address\", (string) The fabcoin address of the transaction. Not present for move transactions (category = move).\n" 2322 " \"category\":\"send|receive\", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n" 2323 " \"amount\": x.xxx, (numeric) The amount in " +
2324 CURRENCY_UNIT +
". This is negative for the 'send' category, and for the 'move' category for moves \n" 2325 " outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n" 2326 " \"vout\" : n, (numeric) the vout value\n" 2327 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
2328 CURRENCY_UNIT +
". This is negative and only available for the 'send' category of transactions.\n" 2329 " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n" 2330 " When it's < 0, it means the transaction conflicted that many blocks ago.\n" 2331 " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n" 2332 " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions.\n" 2333 " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 2334 " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" 2335 " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n" 2336 " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n" 2337 " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 2338 " may be unknown for unconfirmed transactions not in the mempool\n" 2339 " \"abandoned\": xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n" 2340 " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" 2341 " \"label\" : \"label\" (string) A comment for the address/transaction, if any\n" 2342 " \"to\": \"...\", (string) If a comment to is associated with the transaction.\n" 2345 " <structure is the same as \"transactions\" above, only present if include_removed=true>\n" 2346 " Note: transactions that were readded in the active chain will appear as-is in this array, and may thus have a positive confirmation count.\n" 2348 " \"lastblock\": \"lastblockhash\" (string) The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones\n" 2351 HelpExampleCli(
"listsinceblock",
"") +
HelpExampleCli(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6") +
HelpExampleRpc(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6"));
2357 int target_confirms = 1;
2368 paltindex = pindex = it->second;
2380 if (target_confirms < 1) {
2395 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
2406 while (include_removed && paltindex && paltindex != pindex) {
2412 if (pwallet->
mapWallet.count(tx->GetHash()) > 0) {
2418 paltindex = paltindex->
pprev;
2426 if (include_removed) ret.
push_back(
Pair(
"removed", removed));
2440 throw std::runtime_error(
2441 "gettransaction \"txid\" ( include_watchonly )\n" 2442 "\nGet detailed information about in-wallet transaction <txid>\n" 2444 "1. \"txid\" (string, required) The transaction id\n" 2445 "2. \"include_watchonly\" (bool, optional, default=false) Whether to include watch-only addresses in balance calculation and details[]\n" 2448 " \"amount\" : x.xxx, (numeric) The transaction amount in " +
2450 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
2451 CURRENCY_UNIT +
". This is negative and only available for the \n" 2452 " 'send' category of transactions.\n" 2453 " \"confirmations\" : n, (numeric) The number of confirmations\n" 2454 " \"blockhash\" : \"hash\", (string) The block hash\n" 2455 " \"blockindex\" : xx, (numeric) The index of the transaction in the block that includes it\n" 2456 " \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n" 2457 " \"txid\" : \"transactionid\", (string) The transaction id.\n" 2458 " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n" 2459 " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n" 2460 " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 2461 " may be unknown for unconfirmed transactions not in the mempool\n" 2462 " \"details\" : [\n" 2464 " \"account\" : \"accountname\", (string) DEPRECATED. The account name involved in the transaction, can be \"\" for the default account.\n" 2465 " \"address\" : \"address\", (string) The fabcoin address involved in the transaction\n" 2466 " \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n" 2467 " \"amount\" : x.xxx, (numeric) The amount in " +
2469 " \"label\" : \"label\", (string) A comment for the address/transaction, if any\n" 2470 " \"vout\" : n, (numeric) the vout value\n" 2471 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
2472 CURRENCY_UNIT +
". This is negative and only available for the \n" 2473 " 'send' category of transactions.\n" 2474 " \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n" 2475 " 'send' category of transactions.\n" 2479 " \"hex\" : \"data\" (string) Raw data for transaction\n" 2483 HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true") +
HelpExampleRpc(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\""));
2503 CAmount nNet = nCredit - nDebit;
2530 throw std::runtime_error(
2531 "abandontransaction \"txid\"\n" 2532 "\nMark in-wallet transaction <txid> as abandoned\n" 2533 "This will mark this transaction and all its in-wallet descendants as abandoned which will allow\n" 2534 "for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions.\n" 2535 "It only works on transactions which are not included in a block and are not currently in the mempool.\n" 2536 "It has no effect on transactions which are already conflicted or abandoned.\n" 2538 "1. \"txid\" (string, required) The transaction id\n" 2541 HelpExampleCli(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") +
HelpExampleRpc(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\""));
2567 throw std::runtime_error(
2568 "backupwallet \"destination\"\n" 2569 "\nSafely copies current wallet file to destination, which can be a directory or a path with filename.\n" 2571 "1. \"destination\" (string) The destination directory or file\n" 2594 throw std::runtime_error(
2595 "keypoolrefill ( newsize )\n" 2596 "\nFills the keypool." +
2599 "1. newsize (numeric, optional, default=100) The new keypool size\n" 2606 unsigned int kpSize = 0;
2624 static void LockWallet(
CWallet* pWallet)
2639 throw std::runtime_error(
2640 "walletpassphrase \"passphrase\" timeout\n" 2641 "\nStores the wallet decryption key in memory for 'timeout' seconds.\n" 2642 "This is needed prior to performing transactions related to private keys such as sending fabcoins\n" 2644 "1. \"passphrase\" (string, required) The wallet passphrase\n" 2645 "2. timeout (numeric, required) The time to keep the decryption key in seconds.\n" 2647 "Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock\n" 2648 "time that overrides the old one.\n" 2650 "\nUnlock the wallet for 60 seconds\n" +
2652 "\nLock the wallet again (before 60 seconds)\n" +
HelpExampleCli(
"walletlock",
"") +
2653 "\nAs json rpc call\n" +
HelpExampleRpc(
"walletpassphrase",
"\"my pass phrase\", 60"));
2666 strWalletPass.reserve(100);
2671 if (strWalletPass.length() > 0) {
2672 if (!pwallet->
Unlock(strWalletPass)) {
2676 throw std::runtime_error(
2677 "walletpassphrase <passphrase> <timeout>\n" 2678 "Stores the wallet decryption key in memory for <timeout> seconds.");
2698 throw std::runtime_error(
2699 "walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n" 2700 "\nChanges the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.\n" 2702 "1. \"oldpassphrase\" (string) The current passphrase\n" 2703 "2. \"newpassphrase\" (string) The new passphrase\n" 2705 HelpExampleCli(
"walletpassphrasechange",
"\"old one\" \"new one\"") +
HelpExampleRpc(
"walletpassphrasechange",
"\"old one\", \"new one\""));
2719 strOldWalletPass.reserve(100);
2723 strNewWalletPass.reserve(100);
2726 if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)
2727 throw std::runtime_error(
2728 "walletpassphrasechange <oldpassphrase> <newpassphrase>\n" 2729 "Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
2747 throw std::runtime_error(
2749 "\nRemoves the wallet encryption key from memory, locking the wallet.\n" 2750 "After calling this method, you will need to call walletpassphrase again\n" 2751 "before being able to call any methods which require the wallet to be unlocked.\n" 2753 "\nSet the passphrase for 2 minutes to perform a transaction\n" +
2755 "\nPerform a send (requires passphrase set)\n" +
HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") +
2756 "\nClear the passphrase since we are done before 2 minutes is up\n" +
HelpExampleCli(
"walletlock",
"") +
2783 throw std::runtime_error(
2784 "encryptwallet \"passphrase\"\n" 2785 "\nEncrypts the wallet with 'passphrase'. This is for first time encryption.\n" 2786 "After this, any calls that interact with private keys such as sending or signing \n" 2787 "will require the passphrase to be set prior the making these calls.\n" 2788 "Use the walletpassphrase call for this, and then walletlock call.\n" 2789 "If the wallet is already encrypted, use the walletpassphrasechange call.\n" 2790 "Note that this will shutdown the server.\n" 2792 "1. \"passphrase\" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.\n" 2794 "\nEncrypt your wallet\n" +
2796 "\nNow set the passphrase to use the wallet, such as for signing or sending fabcoin\n" +
HelpExampleCli(
"walletpassphrase",
"\"my pass phrase\"") +
2797 "\nNow we can do something like sign\n" +
HelpExampleCli(
"signmessage",
"\"address\" \"test message\"") +
2798 "\nNow lock the wallet again by removing the passphrase\n" +
HelpExampleCli(
"walletlock",
"") +
2799 "\nAs a json rpc call\n" +
HelpExampleRpc(
"encryptwallet",
"\"my pass phrase\""));
2813 strWalletPass.reserve(100);
2816 if (strWalletPass.length() < 1)
2817 throw std::runtime_error(
2818 "encryptwallet <passphrase>\n" 2819 "Encrypts the wallet with <passphrase>.");
2829 return "wallet encrypted; Fabcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.";
2840 throw std::runtime_error(
2841 "lockunspent unlock ([{\"txid\":\"txid\",\"vout\":n},...])\n" 2842 "\nUpdates list of temporarily unspendable outputs.\n" 2843 "Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\n" 2844 "If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.\n" 2845 "A locked transaction output will not be chosen by automatic coin selection, when spending fabcoins.\n" 2846 "Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\n" 2847 "is always cleared (by virtue of process exit) when a node stops or fails.\n" 2848 "Also see the listunspent call\n" 2850 "1. unlock (boolean, required) Whether to unlock (true) or lock (false) the specified transactions\n" 2851 "2. \"transactions\" (string, optional) A json array of objects. Each object the txid (string) vout (numeric)\n" 2852 " [ (json array of json objects)\n" 2854 " \"txid\":\"id\", (string) The transaction id\n" 2855 " \"vout\": n (numeric) The output number\n" 2861 "true|false (boolean) Whether the command was successful or not\n" 2864 "\nList the unspent transactions\n" +
2866 "\nLock an unspent transaction\n" +
HelpExampleCli(
"lockunspent",
"false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2867 "\nList the locked transactions\n" +
HelpExampleCli(
"listlockunspent",
"") +
2868 "\nUnlock the transaction again\n" +
HelpExampleCli(
"lockunspent",
"true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2869 "\nAs a json rpc call\n" +
HelpExampleRpc(
"lockunspent",
"false, \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\""));
2876 RPCTypeCheck(request.params, {UniValue::VBOOL, UniValue::VARR});
2878 bool fUnlock = request.params[0].get_bool();
2880 if (request.params.size() == 1) {
2887 for (
unsigned int idx = 0; idx < outputs.
size(); idx++) {
2888 const UniValue& output = outputs[idx];
2899 std::string txid =
find_value(o,
"txid").get_str();
2903 int nOutput =
find_value(o,
"vout").get_int();
2926 throw std::runtime_error(
2928 "\nReturns list of temporarily unspendable outputs.\n" 2929 "See the lockunspent call to lock and unlock transactions for spending.\n" 2933 " \"txid\" : \"transactionid\", (string) The transaction id locked\n" 2934 " \"vout\" : n (numeric) The vout value\n" 2939 "\nList the unspent transactions\n" +
2941 "\nLock an unspent transaction\n" +
HelpExampleCli(
"lockunspent",
"false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2942 "\nList the locked transactions\n" +
HelpExampleCli(
"listlockunspent",
"") +
2943 "\nUnlock the transaction again\n" +
HelpExampleCli(
"lockunspent",
"true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2944 "\nAs a json rpc call\n" +
HelpExampleRpc(
"listlockunspent",
""));
2948 std::vector<COutPoint> vOutpts;
2972 throw std::runtime_error(
2974 "\nSet the transaction fee per kB. Overwrites the paytxfee parameter.\n" 2976 "1. amount (numeric or string, required) The transaction fee in " +
2979 "true|false (boolean) Returns true if successful\n" 3000 throw std::runtime_error(
3002 "Returns an object containing various wallet state info.\n" 3005 " \"walletname\": xxxxx, (string) the wallet name\n" 3006 " \"walletversion\": xxxxx, (numeric) the wallet version\n" 3007 " \"balance\": xxxxxxx, (numeric) the total confirmed balance of the wallet in " +
3009 " \"unconfirmed_balance\": xxx, (numeric) the total unconfirmed balance of the wallet in " +
3011 " \"immature_balance\": xxxxxx, (numeric) the total immature balance of the wallet in " +
3013 " \"txcount\": xxxxxxx, (numeric) the total number of transactions in the wallet\n" 3014 " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\n" 3015 " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated (only counts external keys)\n" 3016 " \"keypoolsize_hd_internal\": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)\n" 3017 " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" 3018 " \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in " +
3020 " \"hdmasterkeyid\": \"<hash160>\" (string) the Hash160 of the HD master pubkey\n" 3037 obj.
push_back(
Pair(
"keypoolsize", (int64_t)kpExternalSize));
3046 if (!masterKeyID.
IsNull())
3054 throw std::runtime_error(
3056 "Returns a list of currently loaded wallets.\n" 3057 "For full information on the wallet, use \"getwalletinfo\"\n" 3059 "[ (json array of strings)\n" 3060 " \"walletname\" (string) the wallet name\n" 3089 throw std::runtime_error(
3090 "resendwallettransactions\n" 3091 "Immediately re-broadcast unconfirmed wallet transactions to all peers.\n" 3092 "Intended only for testing; the wallet code periodically re-broadcasts\n" 3094 "Returns an RPC error if -walletbroadcast is set to false.\n" 3095 "Returns array of transaction ids that were re-broadcast.\n");
3108 for (
const uint256& txid : txids) {
3122 throw std::runtime_error(
3123 "listunspent ( minconf maxconf [\"addresses\",...] [include_unsafe] [query_options])\n" 3124 "\nReturns array of unspent transaction outputs\n" 3125 "with between minconf and maxconf (inclusive) confirmations.\n" 3126 "Optionally filter to only include txouts paid to specified addresses.\n" 3128 "1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n" 3129 "2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n" 3130 "3. \"addresses\" (string) A json array of fabcoin addresses to filter\n" 3132 " \"address\" (string) fabcoin address\n" 3135 "4. include_unsafe (bool, optional, default=true) Include outputs that are not safe to spend\n" 3136 " See description of \"safe\" attribute below.\n" 3137 "5. query_options (json, optional) JSON with query options\n" 3139 " \"minimumAmount\" (numeric or string, default=0) Minimum value of each UTXO in " +
3141 " \"maximumAmount\" (numeric or string, default=unlimited) Maximum value of each UTXO in " +
3143 " \"maximumCount\" (numeric or string, default=unlimited) Maximum number of UTXOs\n" 3144 " \"minimumSumAmount\" (numeric or string, default=unlimited) Minimum sum value of all UTXOs in " +
3148 "[ (array of json object)\n" 3150 " \"txid\" : \"txid\", (string) the transaction id \n" 3151 " \"vout\" : n, (numeric) the vout value\n" 3152 " \"address\" : \"address\", (string) the fabcoin address\n" 3153 " \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n" 3154 " \"scriptPubKey\" : \"key\", (string) the script key\n" 3155 " \"amount\" : x.xxx, (numeric) the transaction output amount in " +
3157 " \"confirmations\" : n, (numeric) The number of confirmations\n" 3158 " \"redeemScript\" : n (string) The redeemScript if scriptPubKey is P2SH\n" 3159 " \"spendable\" : xxx, (bool) Whether we have the private keys to spend this output\n" 3160 " \"solvable\" : xxx, (bool) Whether we know how to spend this output, ignoring the lack of keys\n" 3161 " \"safe\" : xxx (bool) Whether this output is considered safe to spend. Unconfirmed transactions\n" 3162 " from outside keys and unconfirmed replacement transactions are considered unsafe\n" 3163 " and are not eligible for spending by fundrawtransaction and sendtoaddress.\n" 3169 HelpExampleCli(
"listunspent",
"") +
HelpExampleCli(
"listunspent",
"6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"") +
HelpExampleRpc(
"listunspent",
"6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"") +
HelpExampleCli(
"listunspent",
"6 9999999 '[]' true '{ \"minimumAmount\": 0.005 }'") +
HelpExampleRpc(
"listunspent",
"6, 9999999, [] , true, { \"minimumAmount\": 0.005 } "));
3177 int nMaxDepth = 9999999;
3183 std::set<CFabcoinAddress> setAddress;
3187 for (
unsigned int idx = 0; idx < inputs.
size(); idx++) {
3188 const UniValue& input = inputs[idx];
3192 if (setAddress.count(
address))
3198 bool include_unsafe =
true;
3205 CAmount nMaximumAmount = MAX_MONEY;
3206 CAmount nMinimumSumAmount = MAX_MONEY;
3207 uint64_t nMaximumCount = 0;
3212 if (options.
exists(
"minimumAmount"))
3215 if (options.
exists(
"maximumAmount"))
3218 if (options.
exists(
"minimumSumAmount"))
3221 if (options.
exists(
"maximumCount"))
3222 nMaximumCount = options[
"maximumCount"].get_int64();
3226 std::vector<COutput> vecOutputs;
3227 assert(pwallet !=
nullptr);
3230 pwallet->
AvailableCoins(vecOutputs, !include_unsafe,
nullptr, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount, nMinDepth, nMaxDepth);
3231 for (
const COutput& out : vecOutputs) {
3233 const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;
3236 if (setAddress.size() && (!fValidAddress || !setAddress.count(address)))
3243 if (fValidAddress) {
3253 if (pwallet->
GetCScript(hash, redeemScript)) {
3279 throw std::runtime_error(
3280 "fundrawtransaction \"hexstring\" ( options )\n" 3281 "\nAdd inputs to a transaction until it has enough in value to meet its out value.\n" 3282 "This will not modify existing inputs, and will add at most one change output to the outputs.\n" 3283 "No existing outputs will be modified unless \"subtractFeeFromOutputs\" is specified.\n" 3284 "Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.\n" 3285 "The inputs added will not be signed, use signrawtransaction for that.\n" 3286 "Note that all existing inputs must have their previous output transaction be in the wallet.\n" 3287 "Note that all inputs selected must be of standard form and P2SH scripts must be\n" 3288 "in the wallet using importaddress or addmultisigaddress (to calculate fees).\n" 3289 "You can see whether this is the case by checking the \"solvable\" field in the listunspent output.\n" 3290 "Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only\n" 3292 "1. \"hexstring\" (string, required) The hex string of the raw transaction\n" 3293 "2. options (object, optional)\n" 3295 " \"changeAddress\" (string, optional, default pool address) The fabcoin address to receive the change\n" 3296 " \"changePosition\" (numeric, optional, default random) The index of the change output\n" 3297 " \"includeWatching\" (boolean, optional, default false) Also select inputs which are watch only\n" 3298 " \"lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs\n" 3299 " \"feeRate\" (numeric, optional, default not set: makes wallet determine the fee) Set a specific feerate (" +
3301 " \"subtractFeeFromOutputs\" (array, optional) A json array of integers.\n" 3302 " The fee will be equally deducted from the amount of each specified output.\n" 3303 " The outputs are specified by their zero-based index, before any change output is added.\n" 3304 " Those recipients will receive less fabcoins than you enter in their corresponding amount field.\n" 3305 " If no outputs are specified here, the sender pays the fee.\n" 3306 " [vout_index,...]\n" 3307 " \"replaceable\" (boolean, optional) Marks this transaction as BIP125 replaceable.\n" 3308 " Allows this transaction to be replaced by a transaction with higher fees\n" 3309 " \"conf_target\" (numeric, optional) Confirmation target (in blocks)\n" 3310 " \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n" 3313 " \"CONSERVATIVE\"\n" 3315 " for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n" 3318 " \"hex\": \"value\", (string) The resulting raw transaction (hex-encoded string)\n" 3319 " \"fee\": n, (numeric) Fee in " +
3321 " \"changepos\": n (numeric) The position of the added change output, or -1\n" 3324 "\nCreate a transaction with no inputs\n" +
3325 HelpExampleCli(
"createrawtransaction",
"\"[]\" \"{\\\"myaddress\\\":0.01}\"") +
3326 "\nAdd sufficient unsigned inputs to meet the output value\n" +
HelpExampleCli(
"fundrawtransaction",
"\"rawtransactionhex\"") +
3327 "\nSign the transaction\n" +
HelpExampleCli(
"signrawtransaction",
"\"fundedtransactionhex\"") +
3328 "\nSend the transaction\n" +
HelpExampleCli(
"sendrawtransaction",
"\"signedtransactionhex\""));
3333 int changePosition = -1;
3334 bool lockUnspents =
false;
3336 std::set<int> setSubtractFeeFromOutputs;
3362 if (options.
exists(
"changeAddress")) {
3371 if (options.
exists(
"changePosition"))
3372 changePosition = options[
"changePosition"].get_int();
3374 if (options.
exists(
"includeWatching"))
3377 if (options.
exists(
"lockUnspents"))
3378 lockUnspents = options[
"lockUnspents"].get_bool();
3380 if (options.
exists(
"feeRate")) {
3385 if (options.
exists(
"subtractFeeFromOutputs"))
3386 subtractFeeFromOutputs = options[
"subtractFeeFromOutputs"].get_array();
3388 if (options.
exists(
"replaceable")) {
3391 if (options.
exists(
"conf_target")) {
3392 if (options.
exists(
"feeRate")) {
3397 if (options.
exists(
"estimate_mode")) {
3398 if (options.
exists(
"feeRate")) {
3413 if (tx.
vout.size() == 0)
3416 if (changePosition != -1 && (changePosition < 0 || (
unsigned int)changePosition > tx.
vout.size()))
3419 for (
unsigned int idx = 0; idx < subtractFeeFromOutputs.
size(); idx++) {
3420 int pos = subtractFeeFromOutputs[idx].
get_int();
3421 if (setSubtractFeeFromOutputs.count(pos))
3425 if (pos >=
int(tx.
vout.size()))
3427 setSubtractFeeFromOutputs.insert(pos);
3431 std::string strFailReason;
3433 if (!pwallet->
FundTransaction(tx, nFeeOut, changePosition, strFailReason, lockUnspents, setSubtractFeeFromOutputs, coinControl)) {
3453 throw std::runtime_error(
3454 "bumpfee \"txid\" ( options ) \n" 3455 "\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n" 3456 "An opt-in RBF transaction with the given txid must be in the wallet.\n" 3457 "The command will pay the additional fee by decreasing (or perhaps removing) its change output.\n" 3458 "If the change output is not big enough to cover the increased fee, the command will currently fail\n" 3459 "instead of adding new inputs to compensate. (A future implementation could improve this.)\n" 3460 "The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n" 3461 "By default, the new fee will be calculated automatically using estimatefee.\n" 3462 "The user can specify a confirmation target for estimatefee.\n" 3463 "Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.\n" 3464 "At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n" 3465 "returned by getnetworkinfo) to enter the node's mempool.\n" 3467 "1. txid (string, required) The txid to be bumped\n" 3468 "2. options (object, optional)\n" 3470 " \"confTarget\" (numeric, optional) Confirmation target (in blocks)\n" 3471 " \"totalFee\" (numeric, optional) Total fee (NOT feerate) to pay, in lius.\n" 3472 " In rare cases, the actual fee paid might be slightly higher than the specified\n" 3473 " totalFee if the tx change output has to be removed because it is too close to\n" 3474 " the dust threshold.\n" 3475 " \"replaceable\" (boolean, optional, default true) Whether the new transaction should still be\n" 3476 " marked bip-125 replaceable. If true, the sequence numbers in the transaction will\n" 3477 " be left unchanged from the original. If false, any input sequence numbers in the\n" 3478 " original transaction that were less than 0xfffffffe will be increased to 0xfffffffe\n" 3479 " so the new transaction will not be explicitly bip-125 replaceable (though it may\n" 3480 " still be replaceable in practice, for example if it has unconfirmed ancestors which\n" 3481 " are replaceable).\n" 3482 " \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n" 3485 " \"CONSERVATIVE\"\n" 3489 " \"txid\": \"value\", (string) The id of the new transaction\n" 3490 " \"origfee\": n, (numeric) Fee of the replaced transaction\n" 3491 " \"fee\": n, (numeric) Fee of the new transaction\n" 3492 " \"errors\": [ str... ] (json array of strings) Errors encountered during processing (may be empty)\n" 3495 "\nBump the fee, get the new transaction\'s txid\n" +
3518 if (options.
exists(
"confTarget") && options.
exists(
"totalFee")) {
3519 throw JSONRPCError(
RPC_INVALID_PARAMETER,
"confTarget and totalFee options should not both be set. Please provide either a confirmation target for fee estimation or an explicit total fee for the transaction.");
3520 }
else if (options.
exists(
"confTarget")) {
3522 }
else if (options.
exists(
"totalFee")) {
3523 totalFee = options[
"totalFee"].
get_int64();
3524 if (totalFee <= 0) {
3529 if (options.
exists(
"replaceable")) {
3532 if (options.
exists(
"estimate_mode")) {
3542 CFeeBumper feeBump(pwallet, hash, coin_control, totalFee);
3569 if (!feeBump.
commit(pwallet)) {
3577 for (
const std::string& err : feeBump.
getErrors())
3579 result.push_back(
Pair(
"errors", errors));
3593 throw std::runtime_error(
3594 "generate nblocks ( maxtries )\n" 3595 "\nMine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.\n" 3597 "1. nblocks (numeric, required) How many blocks are generated immediately.\n" 3598 "2. maxtries (numeric, optional) How many iterations to try (default = 1000000).\n" 3600 "[ blockhashes ] (array) hashes of blocks generated\n" 3602 "\nGenerate 11 blocks\n" +
3606 if (!
Params().MineBlocksOnDemand())
3610 uint64_t max_tries = 1000000;
3615 std::shared_ptr<CReserveScript> coinbase_script;
3619 if (!coinbase_script) {
3624 if (coinbase_script->reserveScript.empty()) {
3628 return generateBlocks(coinbase_script, num_generate, max_tries,
true);
3646 {
"rawtransactions",
"fundrawtransaction", &
fundrawtransaction,
false, {
"hexstring",
"options"}},
3649 {
"wallet",
"abortrescan", &
abortrescan,
false, {}},
3650 {
"wallet",
"addmultisigaddress", &
addmultisigaddress,
true, {
"nrequired",
"keys",
"account"}},
3652 {
"wallet",
"backupwallet", &
backupwallet,
true, {
"destination"}},
3653 {
"wallet",
"bumpfee", &
bumpfee,
true, {
"txid",
"options"}},
3654 {
"wallet",
"dumpprivkey", &
dumpprivkey,
true, {
"address"}},
3655 {
"wallet",
"dumpwallet", &
dumpwallet,
true, {
"filename"}},
3656 {
"wallet",
"encryptwallet", &
encryptwallet,
true, {
"passphrase"}},
3658 {
"wallet",
"getaccount", &
getaccount,
true, {
"address"}},
3660 {
"wallet",
"getbalance", &
getbalance,
false, {
"account",
"minconf",
"include_watchonly"}},
3661 {
"wallet",
"getnewaddress", &
getnewaddress,
true, {
"account"}},
3666 {
"wallet",
"gettransaction", &
gettransaction,
false, {
"txid",
"include_watchonly"}},
3669 {
"wallet",
"importmulti", &
importmulti,
true, {
"requests",
"options"}},
3670 {
"wallet",
"importprivkey", &
importprivkey,
true, {
"privkey",
"label",
"rescan"}},
3671 {
"wallet",
"importwallet", &
importwallet,
true, {
"filename"}},
3672 {
"wallet",
"importaddress", &
importaddress,
true, {
"address",
"label",
"rescan",
"p2sh"}},
3673 {
"wallet",
"importprunedfunds", &
importprunedfunds,
true, {
"rawtransaction",
"txoutproof"}},
3674 {
"wallet",
"importpubkey", &
importpubkey,
true, {
"pubkey",
"label",
"rescan"}},
3675 {
"wallet",
"keypoolrefill", &
keypoolrefill,
true, {
"newsize"}},
3676 {
"wallet",
"listaccounts", &
listaccounts,
false, {
"minconf",
"include_watchonly"}},
3679 {
"wallet",
"listreceivedbyaccount", &
listreceivedbyaccount,
false, {
"minconf",
"include_empty",
"include_watchonly"}},
3680 {
"wallet",
"listreceivedbyaddress", &
listreceivedbyaddress,
false, {
"minconf",
"include_empty",
"include_watchonly"}},
3681 {
"wallet",
"listsinceblock", &
listsinceblock,
false, {
"blockhash",
"target_confirmations",
"include_watchonly",
"include_removed"}},
3682 {
"wallet",
"listtransactions", &
listtransactions,
false, {
"account",
"count",
"skip",
"include_watchonly"}},
3683 {
"wallet",
"listunspent", &
listunspent,
false, {
"minconf",
"maxconf",
"addresses",
"include_unsafe",
"query_options"}},
3684 {
"wallet",
"listwallets", &
listwallets,
true, {}},
3685 {
"wallet",
"lockunspent", &
lockunspent,
true, {
"unlock",
"transactions"}},
3686 {
"wallet",
"move", &
movecmd,
false, {
"fromaccount",
"toaccount",
"amount",
"minconf",
"comment"}},
3687 {
"wallet",
"sendfrom", &
sendfrom,
false, {
"fromaccount",
"toaddress",
"amount",
"minconf",
"comment",
"comment_to"}},
3688 {
"wallet",
"sendmany", &
sendmany,
false, {
"fromaccount",
"amounts",
"minconf",
"comment",
"subtractfeefrom",
"replaceable",
"conf_target",
"estimate_mode"}},
3689 {
"wallet",
"sendtoaddress", &
sendtoaddress,
false, {
"address",
"amount",
"comment",
"comment_to",
"subtractfeefromamount",
"replaceable",
"conf_target",
"estimate_mode",
"senderAddress",
"changeToSender"}},
3690 {
"wallet",
"setaccount", &
setaccount,
true, {
"address",
"account"}},
3691 {
"wallet",
"settxfee", &
settxfee,
true, {
"amount"}},
3692 {
"wallet",
"signmessage", &
signmessage,
true, {
"address",
"message"}},
3693 {
"wallet",
"walletlock", &
walletlock,
true, {}},
3695 {
"wallet",
"walletpassphrase", &
walletpassphrase,
true, {
"passphrase",
"timeout"}},
3698 {
"generating",
"generate", &
generate,
true, {
"nblocks",
"maxtries"}},
3699 {
"wallet",
"getvmaddress", &
getvmaddress,
true, {
"contractaddress"}},
3701 {
"wallet",
"createcontract", &
createcontract,
false, {
"bytecode",
"gasLimit",
"gasPrice",
"senderAddress",
"broadcast",
"changeToSender"}},
3702 {
"wallet",
"sendtocontract", &
sendtocontract,
false, {
"contractaddress",
"bytecode",
"amount",
"gasLimit",
"gasPrice",
"senderAddress",
"broadcast",
"changeToSender"}},
3710 for (
unsigned int vcidx = 0; vcidx <
ARRAYLEN(commands); vcidx++)
UniValue getunconfirmedbalance(const JSONRPCRequest &request)
No wallet specified (error when there are multiple wallets loaded)
const std::string CURRENCY_UNIT
void RPCTypeCheckObj(const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull, bool fStrict)
CAmount GetFeePerK() const
Return the fee in liu for a size of 1000 bytes.
CSHA256 & Write(const unsigned char *data, size_t len)
std::set< std::set< CTxDestination > > GetAddressGroupings()
const std::string & get_str() const
CKeyID masterKeyID
master key hash160
CAmount GetLegacyBalance(const isminefilter &filter, int minDepth, const std::string *account) const
UniValue listaccounts(const JSONRPCRequest &request)
void AcentryToJSON(const CAccountingEntry &acentry, const std::string &strAccount, UniValue &ret)
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
std::vector< CWalletRef > vpwallets
CFabcoinAddress GetAccountAddress(CWallet *const pwallet, std::string strAccount, bool bForceNew=false)
Keypool ran out, call keypoolrefill first.
int64_t GetOldestKeyPoolTime()
UniValue listaddressgroupings(const JSONRPCRequest &request)
UniValue resendwallettransactions(const JSONRPCRequest &request)
UniValue importwallet(const JSONRPCRequest &request)
UniValue bumpfee(const JSONRPCRequest &request)
int GetDepthInMainChain(const CBlockIndex *&pindexRet) const
Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockch...
void AvailableCoins(std::vector< COutput > &vCoins, bool fOnlySafe=true, const CCoinControl *coinControl=nullptr, const CAmount &nMinimumAmount=1, const CAmount &nMaximumAmount=MAX_MONEY, const CAmount &nMinimumSumAmount=MAX_MONEY, const uint64_t &nMaximumCount=0, const int &nMinDepth=0, const int &nMaxDepth=9999999) const
populate vCoins with vector of available COutputs.
UniValue signmessage(const JSONRPCRequest &request)
bool fAllowWatchOnly
Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria.
Enter the wallet passphrase with walletpassphrase first.
Fabcoin RPC command dispatcher.
CScript _createmultisig_redeemScript(CWallet *const pwallet, const UniValue ¶ms)
Used by addmultisigaddress / createmultisig:
bool AccountMove(std::string strFrom, std::string strTo, CAmount nAmount, std::string strComment="")
CBlockIndex * pprev
pointer to the index of the predecessor of this block
UniValue abandontransaction(const JSONRPCRequest &request)
boost::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
UniValue keypoolrefill(const JSONRPCRequest &request)
std::map< CTxDestination, CAddressBookData > mapAddressBook
CCriticalSection cs_wallet
const uint256 & GetHash() const
UniValue getreceivedbyaddress(const JSONRPCRequest &request)
UniValue getrawchangeaddress(const JSONRPCRequest &request)
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror)
std::vector< uint256 > txids
bool IsPayToScriptHash() const
bool EnsureWalletIsAvailable(CWallet *const pwallet, bool avoidException)
std::string GetName() const
Get a name for this wallet for logging/debugging purposes.
UniValue getaddressesbyaccount(const JSONRPCRequest &request)
std::string strFromAccount
UniValue fundrawtransaction(const JSONRPCRequest &request)
const std::vector< UniValue > & getValues() const
std::string urlDecode(const std::string &urlEncoded)
std::string GetHex() const
static VersionVM GetEVMDefault()
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const override
bool FundTransaction(CMutableTransaction &tx, CAmount &nFeeRet, int &nChangePosInOut, std::string &strFailReason, bool lockUnspents, const std::set< int > &setSubtractFeeFromOutputs, CCoinControl)
Insert additional inputs into the transaction by calling CreateTransaction();.
const Consensus::Params & GetConsensus() const
base58-encoded Fabcoin addresses.
CAmount GetUnconfirmedBalance() const
std::string AccountFromValue(const UniValue &value)
UniValue ValueFromAmount(const CAmount &amount)
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
void ListTransactions(CWallet *const pwallet, const CWalletTx &wtx, const std::string &strAccount, int nMinDepth, bool fLong, UniValue &ret, const isminefilter &filter)
List transactions based on the given criteria.
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
isminetype IsMine(const CKeyStore &keystore, const CScript &scriptPubKey, SigVersion sigversion)
bool operator()(const CKeyID &keyID)
UniValue settxfee(const JSONRPCRequest &request)
uint8_t isminefilter
used for bitflags of isminetype
std::hash for asio::adress
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
assert(len-trim+(2 *lenIndices)<=WIDTH)
void ListLockedCoins(std::vector< COutPoint > &vOutpts) const
unsigned int GetKeyPoolSize()
int64_t GetTxTime() const
UniValue listsinceblock(const JSONRPCRequest &request)
CAmount GetCredit(const isminefilter &filter) const
UniValue getbalance(const JSONRPCRequest &request)
UniValue getfabaddressbyvm(const JSONRPCRequest &request)
uint256 getBumpedTxId() const
bool EncryptWallet(const SecureString &strWalletPassphrase)
UniValue getnewaddress(const JSONRPCRequest &request)
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.
const std::string strMessageMagic
bool fOverrideFeeRate
Override automatic min/max checks on fee, m_feerate must be set if true.
std::string HelpRequiringPassphrase(CWallet *const pwallet)
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull)
Type-check arguments; throws JSONRPCError if wrong type given.
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
Invalid, missing or duplicate parameter.
std::map< CTxDestination, CAmount > GetAddressBalances()
CAmount GetImmatureBalance() const
boost::optional< CFeeRate > m_feerate
Override the default payTxFee if set.
UniValue listreceivedbyaddress(const JSONRPCRequest &request)
bool GetBroadcastTransactions() const
Inquire whether this wallet broadcasts transactions.
bool FeeModeFromString(const std::string &mode_string, FeeEstimateMode &fee_estimate_mode)
UniValue generateBlocks(std::shared_ptr< CReserveScript > coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript)
Generate blocks (mine)
mapValue_t mapValue
Key/value map with information about the transaction.
bool CreateTransaction(const std::vector< CRecipient > &vecSend, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRet, int &nChangePosInOut, std::string &strFailReason, const CCoinControl &coin_control, bool sign=true, CAmount nGasFee=0, bool hasSender=false)
Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also cr...
void WalletTxToJSON(const CWalletTx &wtx, UniValue &entry)
UniValue getwalletinfo(const JSONRPCRequest &request)
std::set< CTxDestination > GetAccountAddresses(const std::string &strAccount) const
std::list< CAccountingEntry > laccentries
int64_t CAmount
Amount in lius (Can be negative)
std::multimap< int64_t, TxPair > TxItems
bool ReadBlockFromDisk(Block &block, const CDiskBlockPos &pos, const Consensus::Params &consensusParams)
Functions for disk access for blocks.
bool SetAddressBook(const CTxDestination &address, const std::string &strName, const std::string &purpose)
UniValue sendmany(const JSONRPCRequest &request)
The wallet passphrase entered was incorrect.
int GetBlocksToMaturity() const
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
size_t KeypoolCountExternalKeys()
bool signTransaction(CWallet *pWallet)
int Height() const
Return the maximal height in the chain.
void push_back(const T &value)
int64_t get_int64() const
void GetAmounts(std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, std::string &strSentAccount, const isminefilter &filter) const
bool push_back(const UniValue &val)
UniValue importaddress(const JSONRPCRequest &request)
bool CheckFinalTx(const CTransaction &tx, int flags)
Check if transaction will be final in the next block to be created.
bool AbandonTransaction(const uint256 &hashTx)
void UnlockCoin(const COutPoint &output)
bool signalRbf
Signal BIP-125 replace by fee.
UniValue getreceivedbyaccount(const JSONRPCRequest &request)
bool AddCScript(const CScript &redeemScript) override
Support for BIP 0013 : see https://github.com/fabcoin/bips/blob/master/bip-0013.mediawiki.
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)
UniValue listwallets(const JSONRPCRequest &request)
int GetVersion()
get the current wallet format (the oldest client version guaranteed to understand this wallet) ...
bool operator()(const CNoDestination &dest) const
UniValue generate(const JSONRPCRequest &request)
UniValue setaccount(const JSONRPCRequest &request)
CTxDestination destChange
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet, txnouttype *typeRet)
uint64_t getBlockGasLimit(unsigned int blockHeight)
void RPCTypeCheckArgument(const UniValue &value, UniValue::VType typeExpected)
Type-check one argument; throws JSONRPCError if wrong type given.
Witnessifier(CWallet *_pwallet)
void Select(const COutPoint &output)
uint256 uint256S(const char *str)
An encapsulated public key.
bool fAllowOtherInputs
If false, allows unselected inputs, but requires all selected inputs be used.
uint32_t ContractHeight
Block height at which Fabcoin Smart Contract hard fork becomes active.
UniValue walletpassphrasechange(const JSONRPCRequest &request)
CAmount GetBalance() const
bool IsWitnessProgram(int &version, std::vector< unsigned char > &program) const
bool IsHex(const std::string &str)
Unexpected type was passed as parameter.
Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
UniValue ListReceived(CWallet *const pwallet, const UniValue ¶ms, bool fByAccounts)
UniValue importprunedfunds(const JSONRPCRequest &request)
Fixed-size raw-byte array container type, with an API optimised for storing hashes.
UniValue dumpwallet(const JSONRPCRequest &request)
UniValue createcontract(const JSONRPCRequest &request)
UniValue sendfrom(const JSONRPCRequest &request)
bool GetReservedKey(CPubKey &pubkey, bool internal=false)
UniValue getaccount(const JSONRPCRequest &request)
std::string ToString() const
General application defined errors.
const CHDChain & GetHDChain() const
bool GetKey(const CKeyID &address, CKey &keyOut) const override
An output of a transaction.
const CBlockIndex * FindFork(const CBlockIndex *pindex) const
Find the last common block between this chain and a block index entry.
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)
bool IsFromMe(const isminefilter &filter) const
CAmount AmountFromValue(const UniValue &value)
Invalid wallet specified.
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< CTxOut > vout
CTxDestination Get() const
std::string FormatMoney(const CAmount &n)
Money parsing/formatting utilities.
void LockCoin(const COutPoint &output)
UniValue sendtoaddress(const JSONRPCRequest &request)
void RPCRunLater(const std::string &name, std::function< void(void)> func, int64_t nSeconds)
Run func nSeconds from now.
CScriptWitness scriptWitness
UniValue getaccountaddress(const JSONRPCRequest &request)
bool SetString(const char *psz, unsigned int nVersionBytes=1)
A transaction with a bunch of additional info that only the owner cares about.
UniValue getnewwitnessaddress(const JSONRPCRequest &request)
void RegisterWalletRPCCommands(CRPCTable &t)
CRIPEMD160 & Write(const unsigned char *data, size_t len)
UniValue getvmaddress(const JSONRPCRequest &request)
UniValue walletlock(const JSONRPCRequest &request)
bool CheckHex(const std::string &str)
std::string GetRejectReason() const
Failed to encrypt the wallet.
Capture information about block/transaction validation.
std::vector< uint256 > ResendWalletTransactionsBefore(int64_t nTime, CConnman *connman)
bool GetKeyID(CKeyID &keyID) const
void GetScriptForMining(std::shared_ptr< CReserveScript > &script)
std::vector< CTransactionRef > vtx
RBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool)
UniValue walletpassphrase(const JSONRPCRequest &request)
const UniValue & get_array() const
bool ChangeWalletPassphrase(const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase)
A key allocated from the key pool.
bool SignCompact(const uint256 &hash, std::vector< unsigned char > &vchSig) const
Create a compact signature (65 bytes), which allows reconstructing the used public key...
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.
Serialized script, used inside transaction inputs and outputs.
int RPCSerializationFlags()
void * memcpy(void *a, const void *b, size_t c)
bool TopUpKeyPool(unsigned int kpSize=0)
Not enough funds in wallet or account.
unsigned int nTimeSmart
Stable timestamp that never changes, and reflects the order a transaction was added to the wallet...
bool push_backV(const std::vector< UniValue > &vec)
int64_t GetAdjustedTime()
bool CanSupportFeature(enum WalletFeature wf) const
check whether we are allowed to upgrade (or already support) to the named feature ...
A reference to a CKey: the Hash160 of its serialized public key.
CAmount getNewFee() const
bool GetAccountPubkey(CPubKey &pubKey, std::string strAccount, bool bForceNew=false)
UniValue addwitnessaddress(const JSONRPCRequest &request)
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
unsigned int ParseConfirmTarget(const UniValue &value)
Check bounds on a command line confirm target.
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
Fee rate in liu per kilobyte: CAmount / kB.
std::unique_ptr< CConnman > g_connman
const UniValue NullUniValue
CWallet * GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
UniValue removeprunedfunds(const JSONRPCRequest &request)
std::string i64tostr(int64_t n)
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE)
Transaction fee set by the user.
BumpFeeResult getResult() const
bool IsWitnessEnabled(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms)
Check whether witness commitments are required for block.
std::map< uint256, CWalletTx > mapWallet
A reference to a CScript: the Hash160 of its serialization (see script.h)
UniValue backupwallet(const JSONRPCRequest &request)
bool GetKeyFromPool(CPubKey &key, bool internal=false)
Standard JSON-RPC 2.0 errors.
A mutable version of CTransaction.
A writer stream (for serialization) that computes a 256-bit hash.
UniValue sendtocontract(const JSONRPCRequest &request)
std::set< uint256 > GetConflicts() const
std::vector< unsigned char > valtype
UniValue dumpprivkey(const JSONRPCRequest &request)
FeeEstimateMode m_fee_mode
Fee estimation mode to control arguments to estimateSmartFee.
CAmount getOldFee() const
UniValue JSONRPCError(int code, const std::string &message)
No valid connection manager instance found.
bool exists(const std::string &key) const
int64_t GetTime()
GetTimeMicros() and GetTimeMillis() both return the system time, but in different units...
struct evm_uint160be address(struct evm_env *env)
unsigned int nTimeReceived
time received by this node
An encapsulated private key.
int nHeight
height of the entry in the chain. The genesis block has height 0
const std::vector< std::string > & getKeys() const
UniValue abortrescan(const JSONRPCRequest &request)
UniValue listunspent(const JSONRPCRequest &request)
UniValue gettransaction(const JSONRPCRequest &request)
A hasher class for SHA-256.
bool BackupWallet(const std::string &strDest)
std::string get_str(std::string::const_iterator begin, std::string::const_iterator end)
const UniValue & get_obj() const
UniValue importmulti(const JSONRPCRequest &request)
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
void SetHex(const char *psz)
UniValue lockunspent(const JSONRPCRequest &request)
UniValue importprivkey(const JSONRPCRequest &request)
UniValue importpubkey(const JSONRPCRequest &request)
UniValue listtransactions(const JSONRPCRequest &request)
void mine(Client &c, int numBlocks)
std::string strOtherAccount
CScript GetScriptForWitness(const CScript &redeemscript)
bool operator()(const CScriptID &scriptID)
const std::vector< std::string > & getErrors() const
bool Set(const CKeyID &id)
UniValue listlockunspent(const JSONRPCRequest &request)
Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type.
std::unique_ptr< FascState > globalState
Global state.
UniValue movecmd(const JSONRPCRequest &request)
int64_t nRelockTime
Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. Caller must arrange for actual relocking to occur via Lock().
UniValue encryptwallet(const JSONRPCRequest &request)
Error parsing or validating structure in raw format.
uint256 GetBlockHash() const
std::string EncodeBase64(const unsigned char *pch, size_t len)
A hasher class for RIPEMD-160.
A signature creator that just produces 72-byte empty signatures.
bool Unlock(const SecureString &strWalletPassphrase)
void EnsureWalletIsUnlocked(CWallet *const pwallet)
bool commit(CWallet *pWalletNonConst)
std::vector< unsigned char > ToByteVector(const T &in)
std::vector< unsigned char > ParseHex(const char *psz)
bool base58toVMAddress(std::string &strAddr, std::vector< unsigned char > &contractAddress)
UniValue listreceivedbyaccount(const JSONRPCRequest &request)
bool CommitTransaction(CWalletTx &wtxNew, CReserveKey &reservekey, CConnman *connman, CValidationState &state)
Call after CreateTransaction unless you want to abort.
UniValue addmultisigaddress(const JSONRPCRequest &request)