Completed mining logic and persistence.