This commit is contained in:
jed
2011-10-20 16:34:22 -07:00
parent 650ee74391
commit 0416d64fdc
16 changed files with 176 additions and 101 deletions

View File

@@ -50,9 +50,26 @@ void Wallet::refreshAccounts()
}
}
void Wallet::transactionAdded(TransactionPtr trans)
{ // TODO: optimize
refreshAccounts();
void Wallet::transactionChanged(TransactionPtr trans)
{
BOOST_FOREACH(Account& account, mYourAccounts)
{
if( account.mAddress == NewcoinAddress::protobufToInternal(trans->from()) ||
account.mAddress == NewcoinAddress::protobufToInternal(trans->dest()) )
{
Ledger::Account* ledgerAccount=theApp->getLedgerMaster().getAccount(account.mAddress);
if(ledgerAccount)
{
account.mAmount= ledgerAccount->first;
account.mSeqNum= ledgerAccount->second;
}else
{
account.mAmount=0;
account.mSeqNum=0;
}
}
}
}
Wallet::Account* Wallet::consolidateAccountOfSize(int64 amount)
@@ -139,10 +156,6 @@ bool Wallet::Account::signTransaction(TransactionPtr trans)
}
// Call after CreateTransaction unless you want to abort
bool Wallet::commitTransaction(TransactionPtr trans)
{
if(trans)