aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-02-14 16:30:55 -0500
committerMarcoFalke <falke.marco@gmail.com>2018-02-16 14:21:52 -0500
commitfa9461473868132a6a23c672b2eea2d29287855d (patch)
treeb990b04c8a4c1aa12546142a381d354b2ea153e7
parentf4f4f51f1a940a239c9b406fe3b362bf3303cbce (diff)
downloadbitcoin-fa9461473868132a6a23c672b2eea2d29287855d.tar.xz
[doc] dev-notes: Members should be initialized
Also, remove mention of threads that were removed long ago
-rw-r--r--doc/developer-notes.md20
-rw-r--r--src/miner.cpp6
2 files changed, 14 insertions, 12 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 9dc63a1e4b..ac1f52b492 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -238,12 +238,8 @@ Threads
- DumpAddresses : Dumps IP addresses of nodes to peers.dat.
-- ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used in 500ms.
-
- ThreadRPCServer : Remote procedure call handler, listens on port 8332 for connections and services them.
-- BitcoinMiner : Generates bitcoins (if wallet is enabled).
-
- Shutdown : Does an orderly shutdown of everything.
Ignoring IDE/editor files
@@ -380,6 +376,18 @@ C++ data structures
- *Rationale*: Easier to understand what is happening, thus easier to spot mistakes, even for those
that are not language lawyers
+- Initialize all non-static class members where they are defined
+
+ - *Rationale*: Initializing the members in the declaration makes it easy to spot uninitialized ones,
+ and avoids accidentally reading uninitialized memory
+
+```cpp
+class A
+{
+ uint32_t m_count{0};
+}
+```
+
Strings and formatting
------------------------
@@ -415,11 +423,11 @@ member name:
```c++
class AddressBookPage
{
- Mode mode;
+ Mode m_mode;
}
AddressBookPage::AddressBookPage(Mode _mode) :
- mode(_mode)
+ m_mode(_mode)
...
```
diff --git a/src/miner.cpp b/src/miner.cpp
index dda52790c6..fcb376c6cb 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -30,12 +30,6 @@
#include <queue>
#include <utility>
-//////////////////////////////////////////////////////////////////////////////
-//
-// BitcoinMiner
-//
-
-//
// Unconfirmed transactions in the memory pool often depend on other
// transactions in the memory pool. When we select transactions from the
// pool, we select by highest fee rate of a transaction combined with all