Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,030 Lines • ▼ Show 20 Lines | static UniValue resendwallettransactions(const Config &config, | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"resendwallettransactions\n" | "resendwallettransactions\n" | ||||
"Immediately re-broadcast unconfirmed wallet transactions to all " | "Immediately re-broadcast unconfirmed wallet transactions to all " | ||||
"peers.\n" | "peers.\n" | ||||
"Intended only for testing; the wallet code periodically " | "Intended only for testing; the wallet code periodically " | ||||
"re-broadcasts\n" | "re-broadcasts\n" | ||||
"automatically.\n" | "automatically.\n" | ||||
"Returns an RPC error if -walletbroadcast is set to false.\n" | |||||
"Returns array of transaction ids that were re-broadcast.\n"); | "Returns array of transaction ids that were re-broadcast.\n"); | ||||
} | } | ||||
if (!g_connman) { | if (!g_connman) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_CLIENT_P2P_DISABLED, | RPC_CLIENT_P2P_DISABLED, | ||||
"Error: Peer-to-peer functionality missing or disabled"); | "Error: Peer-to-peer functionality missing or disabled"); | ||||
} | } | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
if (!pwallet->GetBroadcastTransactions()) { | |||||
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet transaction " | |||||
"broadcasting is disabled with " | |||||
"-walletbroadcast"); | |||||
} | |||||
std::vector<uint256> txids = | std::vector<uint256> txids = | ||||
pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get()); | pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get()); | ||||
UniValue result(UniValue::VARR); | UniValue result(UniValue::VARR); | ||||
for (const uint256 &txid : txids) { | for (const uint256 &txid : txids) { | ||||
result.push_back(txid.ToString()); | result.push_back(txid.ToString()); | ||||
} | } | ||||
return result; | return result; | ||||
▲ Show 20 Lines • Show All 489 Lines • Show Last 20 Lines |