Cleanup/debug.

This commit is contained in:
JoelKatz
2012-01-17 20:39:16 -08:00
parent 5ba945b8e3
commit 93c7333c58
2 changed files with 19 additions and 4 deletions

View File

@@ -1,4 +1,6 @@
#include "json/writer.h"
#include "LocalTransaction.h"
#include "Application.h"
#include "Wallet.h"
@@ -8,10 +10,24 @@ bool LocalTransaction::makeTransaction()
if(!!mTransaction) return true;
LocalAccount::pointer lac(theApp->getWallet().findAccountForTransaction(mAmount));
if(!lac) return false;
if(!lac)
{
std::cerr << "Account with sufficient balance not found" << std::endl;
return false;
}
mTransaction=Transaction::pointer(new Transaction(lac, mDestAcctID, mAmount, mTag,
theApp->getOPs().getCurrentLedgerID()));
if(mTransaction->getStatus()!=NEW) return false;
if(mTransaction->getStatus()!=NEW)
{
#ifdef DEBUG
std::cerr << "Status not NEW" << std::endl;
Json::Value t=mTransaction->getJson(true);
Json::StyledStreamWriter w;
w.write(std::cerr, t);
#endif
return false;
}
return true;
}