And in the future, these checks can be updated to not use the chain interface at all.
For the chain
topic this seems a good solution going forward.
Otherwise, I am not sure why you are interested in moving this code. These are checks that can make the wallet creation process fail or at least print a warning. So this seems to be a good place for it. Fee options are part of the wallet “world”. Maybe the confusion is because these are config options and not args of createwallet
? Or you don’t see the direct connection between fee options and the wallet? These options are only relevant to the wallet and thus are only checked once the user wants to create a wallet because only then weird numbers there can be dangerous for the user.
On a smaller, organizational scale some of these checks could probably be helper functions and overall the fee part of wallet create can probably be encapsulated similar to AttachChain
. If, however, you want to challenge that fee checks are done at all during wallet creation, that would require a lot more conceptual discussion. After that conceptual discussion, there could be a decision on where to put it. But the chances of a significant change in this regard are slim because this would be a huge behavior change I think, potentially breaking compatibility with any program that uses the wallet because these options will need to be set and checked in some kind of way.
Just some first thoughts by someone also not very familiar with the codebase :) If you have ideas or want to challenge this in general as I teased above I would recommend you to bring that as a topic to one of the next wallet IRC meetings, this Friday for example.