diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-10-19 18:34:06 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2013-10-26 14:51:46 +0200 |
commit | 00588c3fac4822d42ffde46ca55c029a74c378ee (patch) | |
tree | 9e3d048531cae00793f32b9e4a05116986cc1f58 /src/main.h | |
parent | e010af7089b18af838b74a4dc7908885c1600d13 (diff) |
Use boost signals for callbacks from main to wallet
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/main.h b/src/main.h index 76de47071e..82a533749e 100644 --- a/src/main.h +++ b/src/main.h @@ -17,7 +17,6 @@ #include <list> -class CWallet; class CBlock; class CBlockIndex; class CKeyItem; @@ -81,8 +80,6 @@ extern uint64 nLastBlockTx; extern uint64 nLastBlockSize; extern const std::string strMessageMagic; extern int64 nTimeBestReceived; -extern CCriticalSection cs_setpwalletRegistered; -extern std::set<CWallet*> setpwalletRegistered; extern bool fImporting; extern bool fReindex; extern bool fBenchmark; @@ -108,17 +105,18 @@ class CCoinsView; class CCoinsViewCache; class CScriptCheck; class CValidationState; +class CWalletInterface; struct CBlockTemplate; /** Register a wallet to receive updates from core */ -void RegisterWallet(CWallet* pwalletIn); +void RegisterWallet(CWalletInterface* pwalletIn); /** Unregister a wallet from core */ -void UnregisterWallet(CWallet* pwalletIn); +void UnregisterWallet(CWalletInterface* pwalletIn); /** Unregister all wallets from core */ void UnregisterAllWallets(); /** Push an updated transaction to all registered wallets */ -void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL, bool fUpdate = false); +void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL); /** Register with a network node to receive its signals */ void RegisterNodeSignals(CNodeSignals& nodeSignals); @@ -190,9 +188,6 @@ bool AbortNode(const std::string &msg); - -bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut); - struct CDiskBlockPos { int nFile; @@ -1256,4 +1251,18 @@ public: ) }; + +class CWalletInterface { +protected: + virtual void SyncTransaction(const uint256 &hash, const CTransaction &tx, const CBlock *pblock) =0; + virtual void EraseFromWallet(const uint256 &hash) =0; + virtual void SetBestChain(const CBlockLocator &locator) =0; + virtual void UpdatedTransaction(const uint256 &hash) =0; + virtual void Inventory(const uint256 &hash) =0; + virtual void ResendWalletTransactions() =0; + friend void ::RegisterWallet(CWalletInterface*); + friend void ::UnregisterWallet(CWalletInterface*); + friend void ::UnregisterAllWallets(); +}; + #endif |