Extracted DB transaction operations to new module.
Removed unused parameter.
Cancelled transactions now get marked as cancelled in DB.