mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Tie to new code.
This commit is contained in:
@@ -762,6 +762,12 @@ void Wallet::syncToLedger(bool force, Ledger* ledger)
|
||||
if(mLedger<ledger->getLedgerSeq()) mLedger=ledger->getLedgerSeq();
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
// We can't replicate the transaction logic in the wallet
|
||||
// The right way is to apply the transactions to the ledger
|
||||
// And then sync all affected accounts to the ledger
|
||||
|
||||
void Wallet::applyTransaction(Transaction::pointer txn)
|
||||
{
|
||||
TransStatus st=txn->getStatus();
|
||||
@@ -830,6 +836,8 @@ void Wallet::applyTransaction(Transaction::pointer txn)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void Wallet::addLocalTransactions(Json::Value& ret)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||
@@ -851,11 +859,11 @@ bool Wallet::getTxJson(const uint256& txn, Json::Value& ret)
|
||||
bool Wallet::getTxsJson(const NewcoinAddress& account, Json::Value& ret)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||
for(std::map<uint256, LocalTransaction::pointer>::iterator it=mTransactions.begin();
|
||||
it!=mTransactions.end(); ++it)
|
||||
for(std::map<uint256, LocalTransaction::pointer>::iterator it = mTransactions.begin(),
|
||||
end = mTransactions.end(); it != end; ++it)
|
||||
{
|
||||
Transaction::pointer txn = it->second->getTransaction();
|
||||
if(txn && ((account==txn->getFromAccount())||(account==txn->getToAccount())) )
|
||||
if(txn && (account == txn->getFromAccount())) // FIXME: Need a way to get all accounts a txn affects
|
||||
ret[it->first.GetHex()] = it->second->getJson();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user