diff --git a/RPCServer.cpp b/RPCServer.cpp index e4931060a4..c95947fb14 100644 --- a/RPCServer.cpp +++ b/RPCServer.cpp @@ -393,6 +393,9 @@ Json::Value RPCServer::doTx(Json::Value& params) std::string param1, param2; if(!extractString(param1, params, 0)) { // all local transactions + Json::Value ret(Json::objectValue); + theApp->getWallet().addLocalTransactions(ret); + return ret; } if(Transaction::isHexTxID(param1)) diff --git a/Wallet.cpp b/Wallet.cpp index e1592546f1..f0e06a6490 100644 --- a/Wallet.cpp +++ b/Wallet.cpp @@ -882,3 +882,11 @@ void Wallet::applyTransaction(Transaction::pointer txn) } } } + +void Wallet::addLocalTransactions(Json::Value& ret) +{ + boost::recursive_mutex::scoped_lock sl(mLock); + for(std::map::iterator it=mTransactions.begin(); + it!=mTransactions.end(); ++it) + ret[it->first.GetHex()]=it->second->getJson(); +} diff --git a/Wallet.h b/Wallet.h index 6866d05d08..fc1841311b 100644 --- a/Wallet.h +++ b/Wallet.h @@ -72,6 +72,7 @@ public: bool getFullFamilyInfo(const uint160& family, std::string& name, std::string& comment, std::string& pubGen, bool& isLocked); Json::Value getFamilyJson(const uint160& family); + void addLocalTransactions(Json::Value&); static bool isHexPrivateKey(const std::string&); static bool isHexPublicKey(const std::string&);