refactored wallet to add the concept of invalid transactions and isolate the persistent store