Browse Source

ckdb - ensure (unlikely) summarisation can never affect payout generation

master
kanoi 10 years ago
parent
commit
acdd8203a0
  1. 2
      src/ckdb.h
  2. 10
      src/ckdb_data.c

2
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.0" #define DB_VERSION "1.0.0"
#define CKDB_VERSION DB_VERSION"-1.100" #define CKDB_VERSION DB_VERSION"-1.101"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

10
src/ckdb_data.c

@ -3875,6 +3875,7 @@ bool make_markersummaries(bool msg, char *by, char *code, char *inet,
WORKMARKERS *workmarkers; WORKMARKERS *workmarkers;
K_ITEM *wm_item, *wm_last = NULL; K_ITEM *wm_item, *wm_last = NULL;
tv_t now; tv_t now;
bool ok;
K_RLOCK(workmarkers_free); K_RLOCK(workmarkers_free);
wm_item = last_in_ktree(workmarkers_workinfoid_root, ctx); wm_item = last_in_ktree(workmarkers_workinfoid_root, ctx);
@ -3916,8 +3917,15 @@ bool make_markersummaries(bool msg, char *by, char *code, char *inet,
else else
setnow(&now); setnow(&now);
return sharesummaries_to_markersummaries(NULL, workmarkers, by, code, /* So we can't change any sharesummaries/markersummaries while a
* payout is being generated
* N.B. this is a long lock since it stores the markersummaries */
ck_wlock(&process_pplns_lock);
ok = sharesummaries_to_markersummaries(NULL, workmarkers, by, code,
inet, &now, trf_root); inet, &now, trf_root);
ck_wunlock(&process_pplns_lock);
return ok;
} }
void dsp_workmarkers(K_ITEM *item, FILE *stream) void dsp_workmarkers(K_ITEM *item, FILE *stream)

Loading…
Cancel
Save