Fix applying transactions with a local destination to the wallet.

This commit is contained in:
JoelKatz
2012-01-20 13:43:07 -08:00
parent 5d08754104
commit 50e23112e3
3 changed files with 46 additions and 16 deletions

View File

@@ -43,6 +43,9 @@ Transaction::pointer NetworkOPs::processTransaction(Transaction::pointer trans,
if((r==Ledger::TR_PREASEQ) || (r==Ledger::TR_BADLSEQ))
{ // transaction should be held
#ifdef DEBUG
std::cerr << "Transaction should be held" << std::endl;
#endif
trans->setStatus(HELD);
trans->save();
theApp->getMasterLedger().addHeldTransaction(trans);
@@ -50,12 +53,18 @@ Transaction::pointer NetworkOPs::processTransaction(Transaction::pointer trans,
}
if( (r==Ledger::TR_PASTASEQ) || (r==Ledger::TR_ALREADY) )
{ // duplicate or conflict
#ifdef DEBUG
std::cerr << "Transaction is obsolete" << std::endl;
#endif
trans->setStatus(OBSOLETE);
return trans;
}
if(r==Ledger::TR_SUCCESS)
{
#ifdef DEBUG
std::cerr << "Transaction is now included, synching to wallet" << std::endl;
#endif
trans->setStatus(INCLUDED);
theApp->getWallet().applyTransaction(trans);