<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/Context/interrupt()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel7ContextC9interruptSbyF"
  },
  "title" : "interrupt()"
}
-->

# interrupt()

Interrupts long-running validation operations — reindex, block
import, `ChainstateManager.processBlock`.

```
func interrupt() -> Bool
```

## Return Value

`true` if the kernel accepted the interrupt signal. `false`
indicates the kernel rejected the request (typically because no
interruptible operation was in flight).

## Discussion

Safe to call from any thread. Signals the kernel to stop at the next
safe checkpoint; interruption is cooperative — a call in flight
completes the current step before unwinding. Used by
[`BlockchainSync`](/documentation/BitcoinKernel/BlockchainSync) to stop sync on consumer cancel.