Table of Contents

Class ExitWatchtowerService

Namespace
NArk.Core.Services
Assembly
NArk.Core.dll

Monitors the blockchain for partial tree broadcasts and auto-starts unilateral exits when detected. If someone starts unrolling the tree but doesn't finish, previous owners may claim funds after their CSV timeout. The watchtower detects this and continues the exit automatically.

public class ExitWatchtowerService
Inheritance
ExitWatchtowerService
Inherited Members

Constructors

ExitWatchtowerService(IClientTransport, IVtxoStorage, IVirtualTxStorage, IBitcoinBlockchain, IContractStorage, IWalletProvider, IContractService, UnilateralExitService, ILogger<ExitWatchtowerService>?)

Monitors the blockchain for partial tree broadcasts and auto-starts unilateral exits when detected. If someone starts unrolling the tree but doesn't finish, previous owners may claim funds after their CSV timeout. The watchtower detects this and continues the exit automatically.

public ExitWatchtowerService(IClientTransport transport, IVtxoStorage vtxoStorage, IVirtualTxStorage virtualTxStorage, IBitcoinBlockchain broadcaster, IContractStorage contractStorage, IWalletProvider walletProvider, IContractService contractService, UnilateralExitService exitService, ILogger<ExitWatchtowerService>? logger = null)

Parameters

transport IClientTransport
vtxoStorage IVtxoStorage
virtualTxStorage IVirtualTxStorage
broadcaster IBitcoinBlockchain
contractStorage IContractStorage
walletProvider IWalletProvider
contractService IContractService
exitService UnilateralExitService
logger ILogger<ExitWatchtowerService>

Methods

CheckAndRespondAsync(CancellationToken)

Check for partial tree broadcasts and auto-start exits. Call periodically or on block notifications.

public Task CheckAndRespondAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task