Skip to content

Commit 7565e03

Browse files
committed
Remove SyncWithWallets wrapper function
1 parent 12ee1fe commit 7565e03

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
15421542
}
15431543
}
15441544

1545-
SyncWithWallets(tx, NULL);
1545+
GetMainSignals().SyncTransaction(tx, NULL, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK);
15461546

15471547
return true;
15481548
}
@@ -2775,7 +2775,7 @@ bool static DisconnectTip(CValidationState& state, const CChainParams& chainpara
27752775
// Let wallets know transactions went from 1-confirmed to
27762776
// 0-confirmed or conflicted:
27772777
BOOST_FOREACH(const CTransaction &tx, block.vtx) {
2778-
SyncWithWallets(tx, pindexDelete->pprev);
2778+
GetMainSignals().SyncTransaction(tx, pindexDelete->pprev, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK);
27792779
}
27802780
return true;
27812781
}
@@ -3059,11 +3059,11 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
30593059
// while _not_ holding the cs_main lock
30603060
BOOST_FOREACH(const CTransaction &tx, txConflicted)
30613061
{
3062-
SyncWithWallets(tx, pindexNewTip);
3062+
GetMainSignals().SyncTransaction(tx, pindexNewTip, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK);
30633063
}
30643064
// ... and about transactions that got confirmed:
30653065
for(unsigned int i = 0; i < txChanged.size(); i++)
3066-
SyncWithWallets(std::get<0>(txChanged[i]), std::get<1>(txChanged[i]), std::get<2>(txChanged[i]));
3066+
GetMainSignals().SyncTransaction(std::get<0>(txChanged[i]), std::get<1>(txChanged[i]), std::get<2>(txChanged[i]));
30673067

30683068
// Notify external listeners about the new tip.
30693069
GetMainSignals().UpdatedBlockTip(pindexNewTip, pindexFork, fInitialDownload);

src/validationinterface.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,3 @@ void UnregisterAllValidationInterfaces() {
4747
g_signals.SyncTransaction.disconnect_all_slots();
4848
g_signals.UpdatedBlockTip.disconnect_all_slots();
4949
}
50-
51-
void SyncWithWallets(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock) {
52-
g_signals.SyncTransaction(tx, pindex, posInBlock);
53-
}

src/validationinterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn);
2828
void UnregisterValidationInterface(CValidationInterface* pwalletIn);
2929
/** Unregister all wallets from core */
3030
void UnregisterAllValidationInterfaces();
31-
/** Push an updated transaction to all registered wallets */
32-
void SyncWithWallets(const CTransaction& tx, const CBlockIndex *pindex, int posInBlock = -1);
3331

3432
class CValidationInterface {
3533
protected:
@@ -50,6 +48,8 @@ class CValidationInterface {
5048
struct CMainSignals {
5149
/** Notifies listeners of updated block chain tip */
5250
boost::signals2::signal<void (const CBlockIndex *, const CBlockIndex *, bool fInitialDownload)> UpdatedBlockTip;
51+
/** A posInBlock value for SyncTransaction which indicates the transaction was conflicted, disconnected, or not in a block */
52+
static const int SYNC_TRANSACTION_NOT_IN_BLOCK = -1;
5353
/** Notifies listeners of updated transaction data (transaction, and optionally the block it is found in. */
5454
boost::signals2::signal<void (const CTransaction &, const CBlockIndex *pindex, int posInBlock)> SyncTransaction;
5555
/** Notifies listeners of an updated transaction without new data (for now: a coinbase potentially becoming visible). */

0 commit comments

Comments
 (0)