mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
refactor(dchain): drop dead ctx param from startZAPIngest
The serve goroutine deliberately uses context.Background() (its lifetime is the VM's, cancelled by Shutdown via zapIngestCancel, not the short-lived Initialize ctx), so the ctx parameter was never used. Remove it — no slop. Functionally identical to v1.5.17; the param carried no behavior.
This commit is contained in:
+1
-1
@@ -142,7 +142,7 @@ func (vm *VM) Initialize(ctx context.Context, init block.Init) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := vm.startZAPIngest(ctx, cfg.ZAPIngestAddr); err != nil {
|
||||
if err := vm.startZAPIngest(cfg.ZAPIngestAddr); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -72,9 +72,10 @@ func parseConfig(b []byte) (vmConfig, error) {
|
||||
// VM serves HTTP only). It is ADDITIVE: it reuses RegisterCLOB (the existing socket
|
||||
// seam cmd/dvenue uses) and adds no new handler logic. Must be called under vm.mu,
|
||||
// after the durable state is loaded (so the socket never accepts an order before
|
||||
// the VM can sequence it). The server runs in its own goroutine, cancelled by
|
||||
// Shutdown via zapIngestCancel.
|
||||
func (vm *VM) startZAPIngest(ctx context.Context, addr string) error {
|
||||
// the VM can sequence it). The server runs in its own goroutine whose lifetime is
|
||||
// the VM's — it is cancelled by Shutdown via zapIngestCancel, NOT by the (short-lived)
|
||||
// Initialize context, so no Initialize ctx is taken.
|
||||
func (vm *VM) startZAPIngest(addr string) error {
|
||||
if addr == "" {
|
||||
return nil // HTTP-compat-only: canonical socket not served in this environment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user