diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-13 17:06:57 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-13 17:09:32 +0100 |
commit | cbe7efe9ea6c14a3649d3e10f5f18d2097ebef74 (patch) | |
tree | d9410e394aa67732a3ec74d8127d1408bde95152 /src/net.cpp | |
parent | 0d1160e42185983b398cbc2e2be379002f4a62e9 (diff) | |
parent | 5039e4b61beb937bad33ac4300cc784642782589 (diff) |
Merge #15389: Remove unnecessary const_cast
5039e4b61beb937bad33ac4300cc784642782589 Remove unnecessary const_cast (Julian Fleischer)
Pull request description:
The const_cast
```C++
CBlock &block = const_cast<CBlock&>(chainparams.GenesisBlock());
```
is not necessary as all the functions invoked form this block receive a `const CBlock&` anyway. Simply add the `const` to `block`:
```C++
const CBlock& block = chainparams.GenesisBlock();
```
Casting away `const`, especially from something as precious as the genesis block, feels really weird to me as a reader of bitcoin-core source code.
Tree-SHA512: 0290b2cabb216a60655ded153ed1f213c051fb216cec6f3f810f8b760e276f8def86eb696c492e89631682531e215f56d7897b59685d3aa787bcd80cc4f86c90
Diffstat (limited to 'src/net.cpp')
0 files changed, 0 insertions, 0 deletions