|
|
@@ -3197,7 +3197,7 @@ void block_info_str(char * const out, const struct block_info * const blkinfo)
|
|
|
}
|
|
|
|
|
|
#ifdef HAVE_CURSES
|
|
|
-static void update_block_display(void);
|
|
|
+static void update_block_display(bool);
|
|
|
#endif
|
|
|
|
|
|
// Must only be called with ch_lock held!
|
|
|
@@ -3210,7 +3210,7 @@ void __update_block_title(struct mining_goal_info * const goal)
|
|
|
goal->current_goal_detail = malloc(block_info_str_sz);
|
|
|
block_info_str(goal->current_goal_detail, blkchain->currentblk);
|
|
|
#ifdef HAVE_CURSES
|
|
|
- update_block_display();
|
|
|
+ update_block_display(false);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
@@ -4595,10 +4595,13 @@ void update_block_display_line(const int blky, struct mining_goal_info *goal)
|
|
|
static bool pool_actively_in_use(const struct pool *, const struct pool *);
|
|
|
|
|
|
static
|
|
|
-void update_block_display(void)
|
|
|
+void update_block_display(const bool within_console_lock)
|
|
|
{
|
|
|
struct mining_goal_info *goal, *tmpgoal;
|
|
|
int blky = 3, i, total_found_goals = 0;
|
|
|
+ if (!within_console_lock)
|
|
|
+ if (!curses_active_locked())
|
|
|
+ return;
|
|
|
HASH_ITER(hh, mining_goals, goal, tmpgoal)
|
|
|
{
|
|
|
for (i = 0; i < total_pools; ++i)
|
|
|
@@ -4613,6 +4616,12 @@ void update_block_display(void)
|
|
|
update_block_display_line(blky++, goal);
|
|
|
++total_found_goals;
|
|
|
}
|
|
|
+
|
|
|
+ // We cannot do resizing if called within someone else's console lock
|
|
|
+ if (within_console_lock)
|
|
|
+ return;
|
|
|
+
|
|
|
+ bfg_console_unlock();
|
|
|
if (total_found_goals != active_goals)
|
|
|
{
|
|
|
active_goals = total_found_goals;
|
|
|
@@ -4758,7 +4767,7 @@ one_workable_pool: ;
|
|
|
}
|
|
|
wclrtoeol(statuswin);
|
|
|
|
|
|
- update_block_display();
|
|
|
+ update_block_display(true);
|
|
|
|
|
|
char bwstr[(ALLOC_H2B_SHORT*2)+3+1];
|
|
|
|
|
|
@@ -4959,7 +4968,7 @@ static void switch_logsize(void)
|
|
|
unlock_curses();
|
|
|
}
|
|
|
check_winsizes();
|
|
|
- update_block_display();
|
|
|
+ update_block_display(false);
|
|
|
}
|
|
|
|
|
|
/* For mandatory printing when mutex is already locked */
|
|
|
@@ -7272,7 +7281,7 @@ void switch_pools(struct pool *selected)
|
|
|
mutex_unlock(&lp_lock);
|
|
|
|
|
|
#ifdef HAVE_CURSES
|
|
|
- update_block_display();
|
|
|
+ update_block_display(false);
|
|
|
#endif
|
|
|
}
|
|
|
|