From f7489c8917e1e3f1824c23df81702dffbd4c2de2 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Sun, 13 Mar 2022 23:33:45 -0700
Subject: [PATCH] Save the node status (with "downloading" action value)

More immediately. I wanted to debug the ETA value here and the action wasn't written to the node file here, but later.
---
 src/sbbs3/listfile.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/sbbs3/listfile.cpp b/src/sbbs3/listfile.cpp
index d31eade917..8b99f3b268 100644
--- a/src/sbbs3/listfile.cpp
+++ b/src/sbbs3/listfile.cpp
@@ -1030,12 +1030,14 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
 							}
 						}
 					}
-					getnodedat(cfg.node_num,&thisnode,1);
-					action=NODE_DLNG;
-					t=now + gettimetodl(&cfg, f, cur_cps);
-					localtime_r(&t,&tm);
-					thisnode.aux=(tm.tm_hour*60)+tm.tm_min;
-					putnodedat(cfg.node_num,&thisnode); /* calculate ETA */
+					action = NODE_DLNG;
+					if(getnodedat(cfg.node_num,&thisnode,true) == 0) {
+						thisnode.action = action;
+						t=now + gettimetodl(&cfg, f, cur_cps);
+						localtime_r(&t,&tm);
+						thisnode.aux=(tm.tm_hour*60)+tm.tm_min;
+						putnodedat(cfg.node_num,&thisnode); /* calculate ETA */
+					}
 					start=time(NULL);
 					error=protocol(cfg.prot[i],XFER_DOWNLOAD,path,nulstr,false);
 					end=time(NULL);
-- 
GitLab