mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Revert "UI to alert of respend attempt affecting wallet."
This reverts commit ada5a067c7.
Conflicts:
src/qt/guiconstants.h
src/wallet.h
This commit is contained in:
@@ -274,7 +274,7 @@ bool CWallet::SetMaxVersion(int nVersion)
|
||||
return true;
|
||||
}
|
||||
|
||||
set<uint256> CWallet::GetConflicts(const uint256& txid, bool includeEquivalent) const
|
||||
set<uint256> CWallet::GetConflicts(const uint256& txid) const
|
||||
{
|
||||
set<uint256> result;
|
||||
AssertLockHeld(cs_wallet);
|
||||
@@ -292,8 +292,7 @@ set<uint256> CWallet::GetConflicts(const uint256& txid, bool includeEquivalent)
|
||||
continue; // No conflict if zero or one spends
|
||||
range = mapTxSpends.equal_range(txin.prevout);
|
||||
for (TxSpends::const_iterator it = range.first; it != range.second; ++it)
|
||||
if (includeEquivalent || !wtx.IsEquivalentTo(mapWallet.at(it->second)))
|
||||
result.insert(it->second);
|
||||
result.insert(it->second);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -322,7 +321,6 @@ void CWallet::SyncMetaData(pair<TxSpends::iterator, TxSpends::iterator> range)
|
||||
const uint256& hash = it->second;
|
||||
CWalletTx* copyTo = &mapWallet[hash];
|
||||
if (copyFrom == copyTo) continue;
|
||||
if (!copyFrom->IsEquivalentTo(*copyTo)) continue;
|
||||
copyTo->mapValue = copyFrom->mapValue;
|
||||
copyTo->vOrderForm = copyFrom->vOrderForm;
|
||||
// fTimeReceivedIsTxTime not copied on purpose
|
||||
@@ -610,20 +608,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
|
||||
// Notify UI of new or updated transaction
|
||||
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
|
||||
|
||||
// Notifications for existing transactions that now have conflicts with this one
|
||||
if (fInsertedNew)
|
||||
{
|
||||
BOOST_FOREACH(const uint256& conflictHash, wtxIn.GetConflicts(false))
|
||||
{
|
||||
CWalletTx& txConflict = mapWallet[conflictHash];
|
||||
NotifyTransactionChanged(this, conflictHash, CT_UPDATED); //Updates UI table
|
||||
if (IsFromMe(txConflict) || IsMine(txConflict))
|
||||
{
|
||||
NotifyTransactionChanged(this, conflictHash, CT_GOT_CONFLICT); //Throws dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// notify an external script when a wallet transaction comes in or is updated
|
||||
std::string strCmd = GetArg("-walletnotify", "");
|
||||
|
||||
@@ -646,12 +630,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
|
||||
AssertLockHeld(cs_wallet);
|
||||
bool fExisted = mapWallet.count(tx.GetHash());
|
||||
if (fExisted && !fUpdate) return false;
|
||||
|
||||
bool fIsConflicting = IsConflicting(tx);
|
||||
if (fIsConflicting)
|
||||
nConflictsReceived++;
|
||||
|
||||
if (fExisted || IsMine(tx) || IsFromMe(tx) || fIsConflicting)
|
||||
if (fExisted || IsMine(tx) || IsFromMe(tx))
|
||||
{
|
||||
CWalletTx wtx(this,tx);
|
||||
// Get merkle branch if transaction was found in a block
|
||||
@@ -940,7 +919,7 @@ void CWallet::ReacceptWalletTransactions()
|
||||
|
||||
int nDepth = wtx.GetDepthInMainChain();
|
||||
|
||||
if (!wtx.IsCoinBase() && nDepth < 0 && (IsMine(wtx) || IsFromMe(wtx)))
|
||||
if (!wtx.IsCoinBase() && nDepth < 0)
|
||||
{
|
||||
// Try to add to memory pool
|
||||
LOCK(mempool.cs);
|
||||
@@ -960,13 +939,13 @@ void CWalletTx::RelayWalletTransaction()
|
||||
}
|
||||
}
|
||||
|
||||
set<uint256> CWalletTx::GetConflicts(bool includeEquivalent) const
|
||||
set<uint256> CWalletTx::GetConflicts() const
|
||||
{
|
||||
set<uint256> result;
|
||||
if (pwallet != NULL)
|
||||
{
|
||||
uint256 myHash = GetHash();
|
||||
result = pwallet->GetConflicts(myHash, includeEquivalent);
|
||||
result = pwallet->GetConflicts(myHash);
|
||||
result.erase(myHash);
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user