feat(chat): dedicated ~2.5s poll for the 0-conf fast-scan
The fast-scan was hung on the page's Transactions timer, which is 10–15s on most pages (15s on Chat), so incoming messages still took up to ~15s to appear. Give it its own ~2.5s accumulator (delta-time based, independent of the page cadence) so messages land in a few seconds — network propagation then dominates, which is as fast as 0-conf gets. Still gated behind the warmup/rescan block and self-gated in fastScanChatMemos; the in-flight guard prevents overlapping RPCs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
10
src/app.cpp
10
src/app.cpp
@@ -1168,8 +1168,14 @@ void App::update()
|
||||
} else if (walletDataPage && shouldRefreshRecentTransactions()) {
|
||||
refreshRecentTransactionData();
|
||||
}
|
||||
// 0-conf chat: the normal harvest above only re-scans on a new block, so also do a light
|
||||
// mempool scan of the chat address every cycle to surface messages before confirmation.
|
||||
}
|
||||
// 0-conf chat: a DEDICATED ~2.5s mempool scan of the chat address, independent of the page's
|
||||
// (slower, 10–15s) Transactions cadence — so incoming messages surface in a few seconds. The
|
||||
// normal harvest only re-scans on a new block. Self-gated (no-op without a chat identity /
|
||||
// connection / on lite); the in-flight guard keeps overlapping RPCs from stacking.
|
||||
chat_fast_scan_accum_ += ImGui::GetIO().DeltaTime;
|
||||
if (chat_fast_scan_accum_ >= 2.5f) {
|
||||
chat_fast_scan_accum_ = 0.0f;
|
||||
fastScanChatMemos();
|
||||
}
|
||||
if (network_refresh_.consumeDue(RefreshTimer::Addresses)) {
|
||||
|
||||
Reference in New Issue
Block a user