UNPKG

@bsv/wallet-toolbox-client

Version:
43 lines 1.91 kB
import { DeactivedHeader, Monitor } from '../Monitor'; import { WalletMonitorTask } from './WalletMonitorTask'; /** * Check the `monitor.deactivatedHeaders` for any headers that have been deactivated. * * When headers are found, review matching ProvenTx records and update proof data as appropriate. * * New deactivated headers are pushed onto the `deactivatedHeaders` array. * They must be shifted out as they are processed. * * The current implementation ages deactivation notifications by 10 minutes with each retry. * If a successful proof update confirms original proof data after 3 retries, the original is retained. * * In normal operation there should rarely be any work for this task to perform. * The most common result is that there are no matching proven_txs records because * generating new proven_txs records intentionally lags new block generation to * minimize this disruption. * * It is very disruptive to update a proven_txs record because: * - Sync'ed storage is impacted. * - Generated beefs are impacted. * - Updated proof data may be unavailable at the time a reorg is first reported. * * Proper reorg handling also requires repairing invalid beefs for new transactions when * createAction fails to verify a generated beef against the chaintracker. */ export declare class TaskReorg extends WalletMonitorTask { agedMsecs: number; maxRetries: number; static taskName: string; process: DeactivedHeader[]; constructor(monitor: Monitor, agedMsecs?: number, maxRetries?: number); /** * Shift aged deactivated headers onto `process` array. * @param nowMsecsSinceEpoch current time in milliseconds since epoch. * @returns `run` true iff there are aged deactivated headers to process. */ trigger(nowMsecsSinceEpoch: number): { run: boolean; }; runTask(): Promise<string>; } //# sourceMappingURL=TaskReorg.d.ts.map