MCPcopy Create free account
hub / github.com/LUX-Core/lux / darksend

Function darksend

src/rpcdarksend.cpp:62–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62UniValue darksend(const UniValue& params, bool fHelp) {
63 if (fHelp || params.size() == 0)
64 throw runtime_error(
65 "darksend <Luxaddress> <amount>\n"
66 "Luxaddress, reset, or auto (AutoDenominate)"
67 "<amount> is a real and is rounded to the nearest 0.00000001"
68 + HelpRequiringPassphrase());
69
70 if (pwalletMain->IsLocked())
71 throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
72
73 if (params[0].get_str() == "auto") {
74 if (fMasterNode)
75 return "DarkSend is not supported from masternodes";
76
77 darkSendPool.DoAutomaticDenominating();
78 return "DoAutomaticDenominating";
79 }
80
81 if (params[0].get_str() == "reset") {
82 darkSendPool.SetNull(true);
83 darkSendPool.UnlockCoins();
84 return "successfully reset darksend";
85 }
86
87 if (params.size() != 2)
88 throw runtime_error(
89 "darksend <Luxaddress> <amount>\n"
90 "Luxaddress, denominate, or auto (AutoDenominate)"
91 "<amount> is a real and is rounded to the nearest 0.00000001"
92 + HelpRequiringPassphrase());
93
94 CTxDestination dest = DecodeDestination(params[0].get_str());
95 if (!IsValidDestination(dest))
96 throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Lux address");
97
98 // Amount
99 int64_t nAmount = AmountFromValue(params[1]);
100
101 // Wallet comments
102 CWalletTx wtx;
103 SendMoney(dest, nAmount, wtx, ONLY_DENOMINATED);
104
105 return wtx.GetHash().GetHex();
106}
107
108
109UniValue getpoolinfo(const UniValue& params, bool fHelp) {

Callers

nothing calls this directly

Calls 14

HelpRequiringPassphraseFunction · 0.85
JSONRPCErrorFunction · 0.85
DecodeDestinationFunction · 0.85
IsValidDestinationFunction · 0.85
AmountFromValueFunction · 0.85
IsLockedMethod · 0.80
get_strMethod · 0.80
UnlockCoinsMethod · 0.80
SendMoneyFunction · 0.70
sizeMethod · 0.45
SetNullMethod · 0.45

Tested by

no test coverage detected