From 9b98faa25e472cd59f57467d54865d2012ac55a2 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 21 Feb 2013 21:23:33 +0400 Subject: [PATCH] Add resendtx RPC call --- src/bitcoinrpc.cpp | 16 ++++++++++++++++ src/main.cpp | 2 +- src/main.h | 5 +---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 9f39a032dc..42852c01d5 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -2388,6 +2388,21 @@ Value repairwallet(const Array& params, bool fHelp) return result; } +// NovaCoin: resend unconfirmed wallet transactions +Value resendtx(const Array& params, bool fHelp) +{ + if (fHelp || params.size() > 1) + throw runtime_error( + "resendtx\n" + "Re-send unconfirmed transactions.\n" + ); + + ResendWalletTransactions(); + + return Value::null; +} + + // ppcoin: make a public-private key pair Value makekeypair(const Array& params, bool fHelp) { @@ -2549,6 +2564,7 @@ static const CRPCCommand vRPCCommands[] = { "reservebalance", &reservebalance, false}, { "checkwallet", &checkwallet, false}, { "repairwallet", &repairwallet, false}, + { "resendtx", &resendtx, false}, { "makekeypair", &makekeypair, false}, { "sendalert", &sendalert, false}, }; diff --git a/src/main.cpp b/src/main.cpp index 63e326e396..c27b8c2041 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -165,7 +165,7 @@ void static Inventory(const uint256& hash) } // ask wallets to resend their transactions -void static ResendWalletTransactions() +void ResendWalletTransactions() { BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered) pwallet->ResendWalletTransactions(); diff --git a/src/main.h b/src/main.h index 56ce0e4c11..781f54a3c0 100644 --- a/src/main.h +++ b/src/main.h @@ -124,10 +124,7 @@ std::string GetWarnings(std::string strFor); uint256 WantedByOrphan(const CBlock* pblockOrphan); const CBlockIndex* GetLastBlockIndex(const CBlockIndex* pindex, bool fProofOfStake); void BitcoinMiner(CWallet *pwallet, bool fProofOfStake); - - - - +void ResendWalletTransactions();