Skip to content

Commit e96486c

Browse files
committed
Merge #10221: Stop treating coinbase outputs differently in GUI: show them at 1conf
608bbcc [qt] Stop treating coinbase outputs differently: show them at 1conf (Matt Corallo) Tree-SHA512: 62ba10520da8b83cf8e97c86dec3ccdcca8b7bfae0174d1a4099d33aa5d11933cc7c248394bf67c2b105211cf7931955816c741957832e703211030c7f4f002f
2 parents 64c45aa + 608bbcc commit e96486c

File tree

3 files changed

+2
-39
lines changed

3 files changed

+2
-39
lines changed

src/qt/transactionrecord.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@
1818
*/
1919
bool TransactionRecord::showTransaction(const CWalletTx &wtx)
2020
{
21-
if (wtx.IsCoinBase())
22-
{
23-
// Ensures we show generated coins / mined transactions at depth 1
24-
if (!wtx.IsInMainChain())
25-
{
26-
return false;
27-
}
28-
}
21+
// There are currently no cases where we hide transactions, but
22+
// we may want to use this in the future for things like RBF.
2923
return true;
3024
}
3125

src/wallet/wallet.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,33 +1155,6 @@ void CWallet::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const
11551155
for (size_t i = 0; i < pblock->vtx.size(); i++) {
11561156
SyncTransaction(pblock->vtx[i], pindex, i);
11571157
}
1158-
1159-
// The GUI expects a NotifyTransactionChanged when a coinbase tx
1160-
// which is in our wallet moves from in-the-best-block to
1161-
// 2-confirmations (as it only displays them at that time).
1162-
// We do that here.
1163-
if (hashPrevBestCoinbase.IsNull()) {
1164-
// Immediately after restart we have no idea what the coinbase
1165-
// transaction from the previous block is.
1166-
// For correctness we scan over the entire wallet, looking for
1167-
// the previous block's coinbase, just in case it is ours, so
1168-
// that we can notify the UI that it should now be displayed.
1169-
if (pindex->pprev) {
1170-
for (const std::pair<uint256, CWalletTx>& p : mapWallet) {
1171-
if (p.second.IsCoinBase() && p.second.hashBlock == pindex->pprev->GetBlockHash()) {
1172-
NotifyTransactionChanged(this, p.first, CT_UPDATED);
1173-
break;
1174-
}
1175-
}
1176-
}
1177-
} else {
1178-
std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(hashPrevBestCoinbase);
1179-
if (mi != mapWallet.end()) {
1180-
NotifyTransactionChanged(this, hashPrevBestCoinbase, CT_UPDATED);
1181-
}
1182-
}
1183-
1184-
hashPrevBestCoinbase = pblock->vtx[0]->GetHash();
11851158
}
11861159

11871160
void CWallet::BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) {

src/wallet/wallet.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,10 +715,6 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
715715
*/
716716
bool AddWatchOnly(const CScript& dest) override;
717717

718-
// Used to NotifyTransactionChanged of the previous block's coinbase when
719-
// the next block comes in
720-
uint256 hashPrevBestCoinbase;
721-
722718
public:
723719
/*
724720
* Main wallet lock.

0 commit comments

Comments
 (0)