dash/src/wallet
Konstantin Akimov f8befc811c
fix: add missing includes and remove obsolete includes (#5562)
## Issue being fixed or feature implemented
Some headers or modules are used objects from STL without including it
directly, it cause compilation failures on some platforms for some
specific compilers such as #5554

## What was done?
Added missing includes and removed obsolete includes for `optional`,
`deque`, `tuple`, `unordered_set`, `unordered_map`, `set` and `atomic`.

Please, note, that this PR doesn't cover all cases, only cases when it
is obviously missing or obviously obsolete.

Also most of changes belongs to to dash specific code; but for cases of
original bitcoin code I keep it untouched, such as missing <map> in
`src/psbt.h`

I used this script to get a list of files/headers which looks suspicious
`./headers-scanner.sh std::optional optional`:
```bash
#!/bin/bash

set -e

function check_includes() {
    obj=$1
    header=$2
    file=$3

    used=0
    included=0

    grep "$obj" "$file" >/dev/null 2>/dev/null && used=1
    grep "include <$header>" $file >/dev/null 2>/dev/null && included=1
    if [ $used == 1 ] && [ $included == 0 ]
        then echo "missing <$header> in $file"
    fi
    if [ $used == 0 ] && [ $included == 1 ]
        then echo "obsolete <$header> in $file"
    fi
}
export -f check_includes

obj=$1
header=$2

find src \( -name '*.h' -or -name '*.cpp' -or -name '*.hpp' \) -exec bash -c 'check_includes "$0" "$1" "$2"'  "$obj" "$header"  {} \;
```

## How Has This Been Tested?
Built code locally

## Breaking Changes
n/a


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-09-07 09:07:02 -05:00
..
test merge bitcoin#24714: Don't use a lambda for Assert/Assume 2023-09-04 20:50:27 -05:00
bdb.cpp Merge #17891: scripted-diff: Replace CCriticalSection with RecursiveMutex 2023-05-24 12:43:57 -05:00
bdb.h fix: add missing includes and remove obsolete includes (#5562) 2023-09-07 09:07:02 -05:00
coincontrol.cpp Merge #15906: [wallet] Move min_depth and max_depth to coin control 2023-04-04 12:45:27 -05:00
coincontrol.h Merge #15906: [wallet] Move min_depth and max_depth to coin control 2023-04-04 12:45:27 -05:00
coinselection.cpp
coinselection.h
context.cpp
context.h
crypter.cpp
crypter.h
db.cpp Merge #17891: scripted-diff: Replace CCriticalSection with RecursiveMutex 2023-05-24 12:43:57 -05:00
db.h Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
fees.cpp
fees.h
init.cpp merge bitcoin#23842: Rename interfaces::WalletClient to interfaces::WalletLoader 2023-09-04 20:50:27 -05:00
interfaces.cpp merge bitcoin#23842: Rename interfaces::WalletClient to interfaces::WalletLoader 2023-09-04 20:50:27 -05:00
ismine.h Merge #17350: doc: Add developer documentation to isminetype 2023-08-28 11:24:41 -05:00
load.cpp Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
load.h
rpcdump.cpp Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
rpcwallet.cpp fix: add missing includes and remove obsolete includes (#5562) 2023-09-07 09:07:02 -05:00
rpcwallet.h Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
salvage.cpp
salvage.h
scriptpubkeyman.cpp Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
scriptpubkeyman.h fix: add missing includes and remove obsolete includes (#5562) 2023-09-07 09:07:02 -05:00
sqlite.cpp
sqlite.h (Partial) Merge #20125: rpc, wallet: Expose database format in getwalletinfo 2023-07-26 15:40:19 +05:30
wallet.cpp Merge #20584: Declare de facto const reference variables/member functions as const 2023-08-29 21:40:46 -05:00
wallet.h fix: add missing includes and remove obsolete includes (#5562) 2023-09-07 09:07:02 -05:00
walletdb.cpp Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
walletdb.h Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
wallettool.cpp Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
wallettool.h
walletutil.cpp
walletutil.h