feat(serve): wire HardforkMonitor into daemon — auto-detect HF5
Some checks are pending
Test / Test (push) Waiting to run
Security Scan / security (push) Successful in 12s

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 04:39:58 +01:00
parent c0692e988d
commit 7f867fea5b
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -77,6 +77,16 @@ func runServe(dataDir, seed string, testnet bool, rpcBind, rpcPort, walletRPC st
rpcSyncLoop(ctx, c, &cfg, forks, seed)
}()
// Start hardfork monitor.
monitor := NewHardforkMonitor(c, forks)
monitor.OnActivation = func(version int, height uint64) {
core.Print(nil, "HARDFORK %d ACTIVATED at height %d", version, height)
if version == 5 && walletRPC != "" {
core.Print(nil, "HF5 ACTIVE — run: core-chain asset deploy-itns --wallet-rpc %s", walletRPC)
}
}
go monitor.Start(ctx)
// Start JSON-RPC server.
srv := daemon.NewServer(c, &cfg)
if walletRPC != "" {