mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Add SYNC_TRANSACTION_NOT_IN_BLOCK constant and fix callers of SyncTransaction
Needed due to out-of-order backporting.
This commit is contained in:
parent
256b9b77a2
commit
f4af44676a
@ -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++)
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ struct CMainSignals {
|
||||
boost::signals2::signal<void (const CBlockIndex *, bool fInitialDownload)> NotifyHeaderTip;
|
||||
/** Notifies listeners of updated block chain tip */
|
||||
boost::signals2::signal<void (const CBlockIndex *, const CBlockIndex *, bool fInitialDownload)> 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<void (const CTransaction &, const CBlockIndex *pindex, int posInBlock)> SyncTransaction;
|
||||
/** Notifies listeners of an updated transaction lock without new data. */
|
||||
|
Loading…
Reference in New Issue
Block a user