[backport] Reject invalid wallets
Summary:
Backport of Bitcoin Core PR#10885: Reject invalid wallets
d84e78e [wallet] Specify wallet name in wallet loading errors (John Newbery) a6da027 Reject invalid wallet files (João Barbosa) 3ef77a0 Reject duplicate wallet filenames (João Barbosa)
Pull request description:
This PR prevents loading the same wallet more than once in a multi wallet scenario. It also prevents loading with invalid files: non regular files or symlinks.
Test Plan: make check && ./test/functional/test_runner.py
Reviewers: deadalnix, jasonbcox, matiu, #bitcoin_abc
Reviewed By: deadalnix, #bitcoin_abc
Subscribers: teamcity
Differential Revision: https://reviews.bitcoinabc.org/D988