Relay double-spends, subject to anti-DOS

cef3711500 (diff-7ec3c68a81efff79b6ca22ac1f1eabbaL929)
This commit is contained in:
lateminer
2018-01-10 21:52:38 +03:00
parent 48feed03ef
commit 72875a2116
12 changed files with 150 additions and 56 deletions

View File

@@ -27,12 +27,12 @@ void UnregisterValidationInterface(CValidationInterface* pwalletIn);
/** Unregister all wallets from core */
void UnregisterAllValidationInterfaces();
/** Push an updated transaction to all registered wallets */
void SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL);
void SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL, bool fRespend = false);
class CValidationInterface {
protected:
virtual void UpdatedBlockTip(const CBlockIndex *pindex) {}
virtual void SyncTransaction(const CTransaction &tx, const CBlock *pblock) {}
virtual void SyncTransaction(const CTransaction &tx, const CBlock *pblock, bool fRespend) {}
virtual void SetBestChain(const CBlockLocator &locator) {}
virtual void UpdatedTransaction(const uint256 &hash) {}
virtual void Inventory(const uint256 &hash) {}
@@ -48,8 +48,8 @@ protected:
struct CMainSignals {
/** Notifies listeners of updated block chain tip */
boost::signals2::signal<void (const CBlockIndex *)> UpdatedBlockTip;
/** Notifies listeners of updated transaction data (transaction, and optionally the block it is found in. */
boost::signals2::signal<void (const CTransaction &, const CBlock *)> SyncTransaction;
/** Notifies listeners of updated transaction data (transaction, optionally the block it is found in, and whether this is a known respend. */
boost::signals2::signal<void (const CTransaction &, const CBlock *, bool)> SyncTransaction;
/** Notifies listeners of an updated transaction without new data (for now: a coinbase potentially becoming visible). */
boost::signals2::signal<void (const uint256 &)> UpdatedTransaction;
/** Notifies listeners of a new active block chain. */