[FIX] saving ledger_id in transaction and log cleanup