diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -267,16 +267,16 @@ class Notifications { public: virtual ~Notifications() {} - virtual void TransactionAddedToMempool(const CTransactionRef &tx) {} - virtual void TransactionRemovedFromMempool(const CTransactionRef &ptx) { + virtual void transactionAddedToMempool(const CTransactionRef &tx) {} + virtual void transactionRemovedFromMempool(const CTransactionRef &ptx) { } virtual void - BlockConnected(const CBlock &block, + blockConnected(const CBlock &block, const std::vector<CTransactionRef> &tx_conflicted, int height) {} - virtual void BlockDisconnected(const CBlock &block, int height) {} - virtual void UpdatedBlockTip() {} - virtual void ChainStateFlushed(const CBlockLocator &locator) {} + virtual void blockDisconnected(const CBlock &block, int height) {} + virtual void updatedBlockTip() {} + virtual void chainStateFlushed(const CBlockLocator &locator) {} }; //! Register handler for notifications. @@ -302,7 +302,7 @@ //! Current RPC serialization flags. virtual int rpcSerializationFlags() = 0; - //! Synchronously send TransactionAddedToMempool notifications about all + //! Synchronously send transactionAddedToMempool notifications about all //! current mempool transactions to the specified handler and return after //! the last one is sent. These notifications aren't coordinated with async //! notifications sent by handleNotifications, so out of date async diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -73,29 +73,29 @@ : m_notifications(std::move(notifications)) {} virtual ~NotificationsProxy() = default; void TransactionAddedToMempool(const CTransactionRef &tx) override { - m_notifications->TransactionAddedToMempool(tx); + m_notifications->transactionAddedToMempool(tx); } void TransactionRemovedFromMempool(const CTransactionRef &tx) override { - m_notifications->TransactionRemovedFromMempool(tx); + m_notifications->transactionRemovedFromMempool(tx); } void BlockConnected( const std::shared_ptr<const CBlock> &block, const CBlockIndex *index, const std::vector<CTransactionRef> &tx_conflicted) override { - m_notifications->BlockConnected(*block, tx_conflicted, + m_notifications->blockConnected(*block, tx_conflicted, index->nHeight); } void BlockDisconnected(const std::shared_ptr<const CBlock> &block, const CBlockIndex *index) override { - m_notifications->BlockDisconnected(*block, index->nHeight); + m_notifications->blockDisconnected(*block, index->nHeight); } void UpdatedBlockTip(const CBlockIndex *index, const CBlockIndex *fork_index, bool is_ibd) override { - m_notifications->UpdatedBlockTip(); + m_notifications->updatedBlockTip(); } void ChainStateFlushed(const CBlockLocator &locator) override { - m_notifications->ChainStateFlushed(locator); + m_notifications->chainStateFlushed(locator); } std::shared_ptr<Chain::Notifications> m_notifications; }; @@ -436,7 +436,7 @@ void requestMempoolTransactions(Notifications ¬ifications) override { LOCK2(::cs_main, ::g_mempool.cs); for (const CTxMemPoolEntry &entry : ::g_mempool.mapTx) { - notifications.TransactionAddedToMempool(entry.GetSharedTx()); + notifications.transactionAddedToMempool(entry.GetSharedTx()); } } NodeContext &m_node; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1037,12 +1037,12 @@ void MarkDirty(); bool AddToWallet(const CWalletTx &wtxIn, bool fFlushOnClose = true); void LoadToWallet(CWalletTx &wtxIn) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); - void TransactionAddedToMempool(const CTransactionRef &tx) override; - void BlockConnected(const CBlock &block, + void transactionAddedToMempool(const CTransactionRef &tx) override; + void blockConnected(const CBlock &block, const std::vector<CTransactionRef> &vtxConflicted, int height) override; - void BlockDisconnected(const CBlock &block, int height) override; - void UpdatedBlockTip() override; + void blockDisconnected(const CBlock &block, int height) override; + void updatedBlockTip() override; int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver &reserver, bool update); @@ -1066,7 +1066,7 @@ Optional<int> max_height, const WalletRescanReserver &reserver, bool fUpdate); - void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; + void transactionRemovedFromMempool(const CTransactionRef &ptx) override; void ReacceptWalletTransactions() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); void ResendWalletTransactions(); struct Balance { @@ -1218,7 +1218,7 @@ bool IsAllFromMe(const CTransaction &tx, const isminefilter &filter) const; Amount GetCredit(const CTransaction &tx, const isminefilter &filter) const; Amount GetChange(const CTransaction &tx) const; - void ChainStateFlushed(const CBlockLocator &loc) override; + void chainStateFlushed(const CBlockLocator &loc) override; DBErrors LoadWallet(bool &fFirstRunRet); DBErrors ZapWalletTx(std::vector<CWalletTx> &vWtx); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -417,7 +417,7 @@ return false; } -void CWallet::ChainStateFlushed(const CBlockLocator &loc) { +void CWallet::chainStateFlushed(const CBlockLocator &loc) { WalletBatch batch(*database); batch.WriteBestBlock(loc); } @@ -1164,7 +1164,7 @@ MarkInputsDirty(ptx); } -void CWallet::TransactionAddedToMempool(const CTransactionRef &ptx) { +void CWallet::transactionAddedToMempool(const CTransactionRef &ptx) { LOCK(cs_wallet); CWalletTx::Confirmation confirm(CWalletTx::Status::UNCONFIRMED, /* block_height */ 0, BlockHash(), @@ -1177,7 +1177,7 @@ } } -void CWallet::TransactionRemovedFromMempool(const CTransactionRef &ptx) { +void CWallet::transactionRemovedFromMempool(const CTransactionRef &ptx) { LOCK(cs_wallet); auto it = mapWallet.find(ptx->GetId()); if (it != mapWallet.end()) { @@ -1185,7 +1185,7 @@ } } -void CWallet::BlockConnected(const CBlock &block, +void CWallet::blockConnected(const CBlock &block, const std::vector<CTransactionRef> &vtxConflicted, int height) { const BlockHash &block_hash = block.GetHash(); @@ -1197,14 +1197,14 @@ CWalletTx::Confirmation confirm(CWalletTx::Status::CONFIRMED, height, block_hash, index); SyncTransaction(block.vtx[index], confirm); - TransactionRemovedFromMempool(block.vtx[index]); + transactionRemovedFromMempool(block.vtx[index]); } for (const CTransactionRef &ptx : vtxConflicted) { - TransactionRemovedFromMempool(ptx); + transactionRemovedFromMempool(ptx); } } -void CWallet::BlockDisconnected(const CBlock &block, int height) { +void CWallet::blockDisconnected(const CBlock &block, int height) { LOCK(cs_wallet); // At block disconnection, this will change an abandoned transaction to @@ -1222,7 +1222,7 @@ } } -void CWallet::UpdatedBlockTip() { +void CWallet::updatedBlockTip() { m_best_block_time = GetTime(); } @@ -4131,7 +4131,7 @@ } } - walletInstance->ChainStateFlushed(chain.getTipLocator()); + walletInstance->chainStateFlushed(chain.getTipLocator()); } else if (wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) { // Make it impossible to disable private keys after creation error = strprintf(_("Error loading %s: Private keys can only be " @@ -4359,7 +4359,7 @@ return nullptr; } } - walletInstance->ChainStateFlushed(chain.getTipLocator()); + walletInstance->chainStateFlushed(chain.getTipLocator()); walletInstance->database->IncrementUpdateCounter(); // Restore wallet transaction metadata after -zapwallettxes=1