diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-30 14:17:31 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-30 14:28:09 +0200 |
commit | 446bb70fcdff61dfdd770e0624a3885fe2a28bb0 (patch) | |
tree | 69fb904c35e1268d5a008f95104b569901d32105 /src/wallet/rpcwallet.cpp | |
parent | d62fed14ab2576994abd66c26d91f393ef6b0efd (diff) | |
parent | 0f5954c434fdd04b9abca6ddc6f1bbf895b6c6be (diff) | |
download | bitcoin-446bb70fcdff61dfdd770e0624a3885fe2a28bb0.tar.xz |
Merge pull request #5940
0f5954c Regression test for ResendWalletTransactions (Gavin Andresen)
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r-- | src/wallet/rpcwallet.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 9318c1b2b1..29f3eda15d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2096,3 +2096,25 @@ Value getwalletinfo(const Array& params, bool fHelp) obj.push_back(Pair("unlocked_until", nWalletUnlockTime)); return obj; } + +Value resendwallettransactions(const Array& params, bool fHelp) +{ + if (fHelp || params.size() != 0) + throw runtime_error( + "resendwallettransactions\n" + "Immediately re-broadcast unconfirmed wallet transactions to all peers.\n" + "Intended only for testing; the wallet code periodically re-broadcasts\n" + "automatically.\n" + "Returns array of transaction ids that were re-broadcast.\n" + ); + + LOCK2(cs_main, pwalletMain->cs_wallet); + + std::vector<uint256> txids = pwalletMain->ResendWalletTransactionsBefore(GetTime()); + Array result; + BOOST_FOREACH(const uint256& txid, txids) + { + result.push_back(txid.ToString()); + } + return result; +} |