diff --git a/lib/ocpp/v16/charge_point_impl.cpp b/lib/ocpp/v16/charge_point_impl.cpp index 5b704dd49..1ebdc1911 100644 --- a/lib/ocpp/v16/charge_point_impl.cpp +++ b/lib/ocpp/v16/charge_point_impl.cpp @@ -384,7 +384,6 @@ void ChargePointImpl::try_resume_transactions(const std::set& resum } const auto stop_energy_wh = std::make_shared(timestamp, meter_stop); - transaction->add_stop_energy_wh(stop_energy_wh); transaction->set_transaction_id(transaction_entry.transaction_id); // we need this in order to handle a StartTransaction.conf transaction->set_start_transaction_message_id(transaction_entry.start_transaction_message_id); @@ -409,6 +408,7 @@ void ChargePointImpl::try_resume_transactions(const std::set& resum EVLOG_info << "Queuing StopTransaction.req for transaction with id: " << transaction_entry.transaction_id << " because it hasn't been acknowledged by CSMS and shall not be resumed."; + transaction->add_stop_energy_wh(stop_energy_wh); this->stop_transaction(transaction_entry.connector, Reason::PowerLoss, std::nullopt); } else { EVLOG_info << "Resuming transaction with transaction id: " << transaction_entry.transaction_id;