Attempt to fix #26112.
As suggested by sipa in #26112 (comment):
CCoinsViewErrorCatcher, the wrapper class used around CCoinsViewDB that’s supposed to detect these problems and forcefully exit the application, has an override for GetCoins. But in CheckTxInputs, HaveInputs is first invoked, which on its turn calls HaveCoin. HaveCoin is implemented in CCoinsViewDB, but not in CCoinsViewErrorCatcher, and thus the disk read exception escapes. A solution may be to just add an override for HaveCoin in CCoinsViewErrorCatcher.
I implemented CCoinsViewErrorCatcher::HaveCoin
and also added a periodic disk space check that shutdowns the node if there is not enough space left on disk, the minimum here is 50MB.
For reviewers, it’s possible to saturate disk space to test the PR by creating large files with fallocate -l 50G test.bin