<translation>Показать подробности транзакции</translation>
</message>
<message>
+ <location line="136"/>
+ <source>Clear orphans</source>
+ <translation>Удалить орфаны</translation>
+ </message>
+ <message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation>Экспортировать данные транзакций</translation>
#include "editaddressdialog.h"
#include "optionsmodel.h"
#include "guiutil.h"
+#include "wallet.h"
#include <QScrollBar>
#include <QComboBox>
QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
QAction *editLabelAction = new QAction(tr("Edit label"), this);
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
+ QAction *clearOrphansAction = new QAction(tr("Clear orphans"), this);
contextMenu = new QMenu();
contextMenu->addAction(copyAddressAction);
contextMenu->addAction(copyTxIDAction);
contextMenu->addAction(editLabelAction);
contextMenu->addAction(showDetailsAction);
+ contextMenu->addSeparator();
+ contextMenu->addAction(clearOrphansAction);
mapperThirdPartyTxUrls = new QSignalMapper(this);
connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
+ connect(clearOrphansAction, SIGNAL(triggered()), this, SLOT(clearOrphans()));
}
void TransactionView::setModel(WalletModel *model)
}
}
+void TransactionView::clearOrphans()
+{
+ if(!model)
+ return;
+
+ model->clearOrphans();
+}
+
void TransactionView::openThirdPartyTxUrl(QString url)
{
if(!transactionView->selectionModel())
for (std::map<CKeyID, CBlockIndex*>::const_iterator it = mapKeyFirstBlock.begin(); it != mapKeyFirstBlock.end(); it++)
mapKeyBirth[it->first] = it->second->nTime - 7200; // block times can be 2h off
}
+
+void CWallet::ClearOrphans()
+{
+ list<uint256> orphans;
+
+ LOCK(cs_wallet);
+ for(map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
+ {
+ const CWalletTx *wtx = &(*it).second;
+ if((wtx->IsCoinBase() || wtx->IsCoinStake()) && !wtx->IsInMainChain())
+ {
+ orphans.push_back(wtx->GetHash());
+ }
+ }
+
+ for(list<uint256>::const_iterator it = orphans.begin(); it != orphans.end(); ++it)
+ EraseFromWallet(*it);
+}
\ No newline at end of file
bool AddToWallet(const CWalletTx& wtxIn);
bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate = false, bool fFindBlock = false);
bool EraseFromWallet(uint256 hash);
+ void ClearOrphans();
void WalletUpdateSpent(const CTransaction& prevout, bool fBlock = false);
int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
int ScanForWalletTransaction(const uint256& hashTx);