CWallet::MarkConflicted may acquire the cs_main lock after
CWalletDB::LoadWallet acquires the cs_wallet lock during wallet initialization.
(CWalletDB::LoadWallet calls ReadKeyValue which calls CWallet::LoadToWallet
which calls CWallet::MarkConflicted). This is the opposite order that cs_main
and cs_wallet locks are acquired in the rest of the code, and so leads to
POTENTIAL DEADLOCK DETECTED errors if bitcoin is built with -DDEBUG_LOCKORDER.
This commit changes CWallet::LoadWallet (which calls CWalletDB::LoadWallet) to
acquire both locks in the standard order. It also fixes some tests that were
acquiring wallet and main locks out of order and failed with the new locking in
CWallet::LoadWallet.
Error was reported by Luke Dashjr <luke-jr@utopios.org> in
https://botbot.me/freenode/bitcoin-core-dev/msg/90244330/
Github-Pull: #11126
Rebased-From: de9a1db2ed
Use POSIX rename atomicity at the `bitcoind` side to create a working
cookie atomically:
- Write `.cookie.tmp`, close file
- Rename `.cookie.tmp` to `.cookie`
This avoids clients reading invalid/partial cookies as in #11129.
Github-Pull: #11131
Rebased-From: 82dd7195e1
A button was removed, so now button(1) is nullptr
Github-Pull: #11332
Rebased-From: cdaf3a1f9e
Tree-SHA512: 0a49bf4e9ab08e5869170c8a212da60c9a6b90c36427d788de384aa4be6d87bb5e00a21edf78eed34f81bbc554b6f15565bb9b493dafcbfe9d6f4664d7424d9d
Prepare for 0.15.1
Tree-SHA512: d306369ebf2090dd3f74ead6ca6b9f3f2d56bcde6eb6aaab22ac38a5f7ab6cdf3da1142ad6fe266f793f27bbed4247397375f6177f2c7ccc1a57de9acaa5a181
fa120bd01 doc: Old fee_estimates.dat are discarded by 0.15.0 (MarcoFalke)
Pull request description:
Tree-SHA512: b4b1cb3efa307a7a0c37b8cc0a35f8fd31c8268747be59efba6530c36ba6423d9fb37e752782c7ebd5bc22a4aa1d2730b0e9ab560239fb2874afd42197ed9fd0
Release version strings were broken in Gitian by 7522. This is a minimal fix
suitable for 0.15.
After this, we should fix up version handling for good so that gitian packages
the correct string in the release tarball, so that git is not required to get
the tag name.
Github-Pull: #11097
Rebased-From: 4452829b10
Tree-SHA512: 40071b97b2207b2262aef0b4802cb231ccafbff0ed04b5945a64dceda8bdbb2ea71bf6a546e1d03533612edfdc55dedd413da967cba0b1bbd3f9139ec3572f60
The hex is already returned in TxToUniv, no need to give it out a
second independent time in getrawtransaction itself.
Github-Pull: #11027
Rebased-From: e029c6e709
Tree-SHA512: 4f7892431ddb9b59bcc59756890b97a20d046d1d4898f8a80c564223e1cde1c922da403cea4b8ae79d70741d1a9ff337f077043e5bb538cdc4d34fbe09301240
Unused function. Mostly reverts c25d90f125
c25d90f... was merged as part of PR 11022 but is not required.
Github-Pull: #11044
Rebased-From: 1221f60c94
Tree-SHA512: da229b128bee5f124c009a1a2adfb4fa879366c81789824c426c9ce5209c835888a7e6cfeb1724551320a98cd08406a605372f84487a0d289cd6e02f9ac3ea21
- Bump "updated for"
- Fix link to boost (haenet mirror is broken)
- Upgrade boost version to 1.64
Github-Pull: #11080
Rebased-From: 5be6e9b4f9
Tree-SHA512: 72877bf32e4f38fb530946c065c23edd683a0da379c33fa3eee4fbeb51e2c97171f5d33ebe1e77f25c3e14779d94e8198cc8fbb6e1055a1024638458ef7cc032
90d4d89 scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL (practicalswift)
Pull request description:
Since C++11 the macro `NULL` may be:
* an integer literal with value zero, or
* a prvalue of type `std::nullptr_t`
By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`.
For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter &
Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
With this patch applied there are no `NULL` macro usages left in the repo:
```
$ git grep NULL -- "*.cpp" "*.h" | egrep -v '(/univalue/|/secp256k1/|/leveldb/|_NULL|NULLDUMMY|torcontrol.*NULL|NULL cert)' | wc -l
0
```
The road towards `nullptr` (C++11) is split into two PRs:
* `NULL` → `nullptr` is handled in PR #10483 (scripted, this PR)
* `0` → `nullptr` is handled in PR #10645 (manual)
Tree-SHA512: 3c395d66f2ad724a8e6fed74b93634de8bfc0c0eafac94e64e5194c939499fefd6e68f047de3083ad0b4eff37df9a8a3a76349aa17d55eabbd8e0412f140a297
3f8fa7f Make sure to clean up mapBlockSource if we've already seen the block (Cory Fields)
Pull request description:
Otherwise we may leave them dangling.
Credit TheBlueMatt.
Tree-SHA512: 8be77e08ebfc4f5b206d5ee7cfbe87f92c1eb5bc2b412471993658fe210306789aaf0f3d1454c635508a7d8effede2cf5ac144d622b0157b872733d9661d65c3