From b79273bb9134bd7191bc7e3215c4f5dae8ecdd62 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sat, 4 Apr 2026 21:07:04 +0100 Subject: [PATCH] At the end of the transfer, exchange information with the other monitor when in "monitor both" mode, so both sides learn each other's final transfer value, to give the correct final ratio (#67). --- src/pv/loop.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pv/loop.c b/src/pv/loop.c index 90aa016..65cc367 100644 --- a/src/pv/loop.c +++ b/src/pv/loop.c @@ -640,6 +640,13 @@ int pv_main_loop(pvstate_t state) || (state->control.delay_start < 0.001)) { pv_elapsedtime_copy(&next_update, &cur_time); } + /* + * In "--monitor both" mode, run a final exchange of + * information with the other side. + */ + if (state->control.othermonitor_pid > 0) { + pv__monitor_exchange(state); + } } /*