diff --git a/src/validation.cpp b/src/validation.cpp index c750f24ac4..d721330af3 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1014,7 +1014,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C } if(!fDryRun) - GetMainSignals().SyncTransaction(tx, NULL); + GetMainSignals().SyncTransaction(tx, NULL, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK); return true; } @@ -2559,7 +2559,7 @@ bool static DisconnectTip(CValidationState& state, const CChainParams& chainpara // Let wallets know transactions went from 1-confirmed to // 0-confirmed or conflicted: BOOST_FOREACH(const CTransaction &tx, block.vtx) { - GetMainSignals().SyncTransaction(tx, pindexDelete->pprev); + GetMainSignals().SyncTransaction(tx, pindexDelete->pprev, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK); } return true; } @@ -2882,7 +2882,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, // while _not_ holding the cs_main lock BOOST_FOREACH(const CTransaction &tx, txConflicted) { - GetMainSignals().SyncTransaction(tx, pindexNewTip); + GetMainSignals().SyncTransaction(tx, pindexNewTip, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK); } // ... and about transactions that got confirmed: for(unsigned int i = 0; i < txChanged.size(); i++) diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index 808c9016a9..7c97f2c5ba 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -56,7 +56,3 @@ void UnregisterAllValidationInterfaces() { g_signals.NotifyHeaderTip.disconnect_all_slots(); g_signals.AcceptedBlockHeader.disconnect_all_slots(); } - -void SyncWithWallets(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock) { - g_signals.SyncTransaction(tx, pindex, posInBlock); -} diff --git a/src/validationinterface.h b/src/validationinterface.h index c3e2d07124..391a594a04 100644 --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -55,6 +55,8 @@ struct CMainSignals { boost::signals2::signal NotifyHeaderTip; /** Notifies listeners of updated block chain tip */ boost::signals2::signal UpdatedBlockTip; + /** A posInBlock value for SyncTransaction which indicates the transaction was conflicted, disconnected, or not in a block */ + static const int SYNC_TRANSACTION_NOT_IN_BLOCK = -1; /** Notifies listeners of updated transaction data (transaction, and optionally the block it is found in. */ boost::signals2::signal SyncTransaction; /** Notifies listeners of an updated transaction lock without new data. */