refactoring check_mempool_result to check if the key doesn’t exists. max_vin precalculated directly. some changes on outputs of logs.
Cleaned up imports and code formatting for readability, refactored methods (like check_mempool_result) for clarity, improved error handling, added comments, and ensured adherence to PEP 8 standards for better maintainability. I hope it helps!