mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 23:15:52 +00:00
Make 'tx' RPC command with no parameteres work. It displays all
"in progress" transactions that affect local accounts.
This commit is contained in:
@@ -393,6 +393,9 @@ Json::Value RPCServer::doTx(Json::Value& params)
|
|||||||
std::string param1, param2;
|
std::string param1, param2;
|
||||||
if(!extractString(param1, params, 0))
|
if(!extractString(param1, params, 0))
|
||||||
{ // all local transactions
|
{ // all local transactions
|
||||||
|
Json::Value ret(Json::objectValue);
|
||||||
|
theApp->getWallet().addLocalTransactions(ret);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Transaction::isHexTxID(param1))
|
if(Transaction::isHexTxID(param1))
|
||||||
|
|||||||
@@ -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<uint256, LocalTransaction::pointer>::iterator it=mTransactions.begin();
|
||||||
|
it!=mTransactions.end(); ++it)
|
||||||
|
ret[it->first.GetHex()]=it->second->getJson();
|
||||||
|
}
|
||||||
|
|||||||
1
Wallet.h
1
Wallet.h
@@ -72,6 +72,7 @@ public:
|
|||||||
bool getFullFamilyInfo(const uint160& family, std::string& name, std::string& comment,
|
bool getFullFamilyInfo(const uint160& family, std::string& name, std::string& comment,
|
||||||
std::string& pubGen, bool& isLocked);
|
std::string& pubGen, bool& isLocked);
|
||||||
Json::Value getFamilyJson(const uint160& family);
|
Json::Value getFamilyJson(const uint160& family);
|
||||||
|
void addLocalTransactions(Json::Value&);
|
||||||
|
|
||||||
static bool isHexPrivateKey(const std::string&);
|
static bool isHexPrivateKey(const std::string&);
|
||||||
static bool isHexPublicKey(const std::string&);
|
static bool isHexPublicKey(const std::string&);
|
||||||
|
|||||||
Reference in New Issue
Block a user