Chain drama: fee tiers, congestion, mempool drops, address poisoning, clipboard hijack, phishing; selected-button style

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Opus 5.5 committed 2026-11-03 23:29:54 +08:00
1 parent 2b781acd82
commit dbba8b4376
15 files changed
+357 -20

No files matched your search

+28
View File
@@ -77,6 +77,33 @@ namespace Decentralized
Log.Guard("夜间结算", Settle);
}
/// <summary>链上的夜间事件:网络拥堵、地址投毒的 0 币转入、钓鱼公告。</summary>
private static void ChainNight(SaveData d, int day)
{
if (day >= d.CongestedUntil && d.Rng.Chance(Tuning.TxCongestionChance))
{
d.CongestedFrom = day + 1;
d.CongestedUntil = day + d.Rng.Range(1, Tuning.TxCongestionDaysMax);
News.Show("pd_news_congest_" + day, L.T("news.congest.title"), L.T("news.congest.desc"), d.CongestedUntil - day);
}
foreach (var p in d.PoisonPlans.Where(x => x.Day <= day + 1).ToList())
{
d.PoisonPlans.Remove(p);
var w = d.Own(p.Wallet);
if (w == null) continue;
string fake = ChainAddress.Lookalike(p.Target, d.Rng);
TxRules.Record(w.History, new TxRecord { Addr = fake, Asset = Assets.PSC, Amount = 0, Day = day + 1, In = true });
Log.Info($"地址投毒:{p.Target} 的相似地址 {fake} 向 {w.Address} 转入 0 币");
}
if (d.Rng.Chance(Tuning.TxPhishChance))
{
string fake = ChainAddress.Make(d.Rng.NextUInt());
if (Unlock.BlackUnlocked && d.Rng.Chance(0.5)) d.Black.Forum.Add("phish:" + fake);
else News.Show("pd_news_phish_" + day, L.T("news.phish.title"), L.T("news.phish.desc", fake), 2);
Log.Info("钓鱼公告:" + fake);
}
}
private static void Settle()
{
var d = Session.Data;
@@ -158,6 +185,7 @@ namespace Decentralized
Log.Info($"投毒钱包 {w.Address} 被转空:{v:0}");
ps.AddNightLog(L.T("nightlog.drained", WalletWindow.NameOf(w), Fmt.Credits(v)), "cc7755");
}
ChainNight(d, day);
foreach (var name in report.Burnt) ps.AddNightLog(L.T("nightlog.burnt", name), "cc7755");
int unpowered = report.Rigs - report.PoweredRigs;
if (unpowered > 0 && units.Count + unpowered > 0) ps.AddNightLog(L.T("nightlog.unpowered", unpowered), "cc7755");