re: #19619 (review)
I think we need to close and destroy the database
. Having it created and potentially open now could interfere with the salvage below.
I’m not sure exactly what change is being asked for here. Closing an unopened database won’t do anything. Goal of this commit is to remove path manipulation from wallet tool while changing it minimally (and nudging code in good future directions), so happy to make any change consistent with that.
We only want to do this for the path existence check.
I don’t think this is right. I think other checks done before opening a database should be done before salvaging a database. Not just checking path existence, but also checking load status and lock status.
I expect having the database object here to be more useful in the future. It’s beyond the scope of this PR, but recovery code below should be able to go through the database object instead of bypassing it.