|
|
@ -24,7 +24,6 @@
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QIcon>
|
|
|
|
#include <QIcon>
|
|
|
|
#include <QList>
|
|
|
|
#include <QList>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Amount column is right-aligned it contains numbers
|
|
|
|
// Amount column is right-aligned it contains numbers
|
|
|
|
static int column_alignments[] = {
|
|
|
|
static int column_alignments[] = {
|
|
|
@ -187,17 +186,25 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TransactionRecord *rec = &cachedWallet[idx];
|
|
|
|
TransactionRecord *rec = &cachedWallet[idx];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get required locks upfront. This avoids the GUI from getting
|
|
|
|
|
|
|
|
// stuck if the core is holding the locks for a longer time - for
|
|
|
|
|
|
|
|
// example, during a wallet rescan.
|
|
|
|
|
|
|
|
//
|
|
|
|
// If a status update is needed (blocks came in since last check),
|
|
|
|
// If a status update is needed (blocks came in since last check),
|
|
|
|
// update the status of this transaction from the wallet. Otherwise,
|
|
|
|
// update the status of this transaction from the wallet. Otherwise,
|
|
|
|
// simply re-use the cached status.
|
|
|
|
// simply re-use the cached status.
|
|
|
|
LOCK2(cs_main, wallet->cs_wallet);
|
|
|
|
TRY_LOCK(cs_main, lockMain);
|
|
|
|
if(rec->statusUpdateNeeded())
|
|
|
|
if(lockMain)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);
|
|
|
|
TRY_LOCK(wallet->cs_wallet, lockWallet);
|
|
|
|
|
|
|
|
if(lockWallet && rec->statusUpdateNeeded())
|
|
|
|
if(mi != wallet->mapWallet.end())
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rec->updateStatus(mi->second);
|
|
|
|
std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(mi != wallet->mapWallet.end())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rec->updateStatus(mi->second);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return rec;
|
|
|
|
return rec;
|
|
|
|