mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
Merge #12434: [doc] dev-notes: Members should be initialized
fa9461473
[doc] dev-notes: Members should be initialized (MarcoFalke)
Pull request description:
Also, remove mention of threads that were removed long ago.
Motivation:
Make it easier to spot bugs such as #11654 and #12426
Tree-SHA512: 8ca1cb54e830e9368803bd98a8b08c39bf2d46f079094ed7e070b32ae15a6e611ce98d7a614f897803309f4728575e6bc9357fab1157c53d2536417eb8271653
This commit is contained in:
parent
c939de0256
commit
28879fc052
@ -244,8 +244,6 @@ 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 9998 for connections and services them.
|
||||
|
||||
- Shutdown : Does an orderly shutdown of everything.
|
||||
@ -395,6 +393,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
|
||||
------------------------
|
||||
|
||||
@ -430,11 +440,11 @@ member name:
|
||||
```c++
|
||||
class AddressBookPage
|
||||
{
|
||||
Mode mode;
|
||||
Mode m_mode;
|
||||
}
|
||||
|
||||
AddressBookPage::AddressBookPage(Mode _mode) :
|
||||
mode(_mode)
|
||||
m_mode(_mode)
|
||||
...
|
||||
```
|
||||
|
||||
|
@ -42,12 +42,6 @@
|
||||
#include <queue>
|
||||
#include <utility>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DashMiner
|
||||
//
|
||||
|
||||
//
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user