UNPKG

@node-lightning/wire

Version:
39 lines (38 loc) 1.45 kB
/// <reference types="node" /> import { ILogger } from "@node-lightning/logger"; import { IMessageSender } from "../Peer"; export declare enum GossipQueriesReceiverState { Idle = 0, Receiving = 1 } /** * This class is used to activate / deactivate receiving of gossip messages * when the gossip_queries or gossip_queries_ex gossip sync strategies are used. */ export declare class GossipQueriesReceiver { readonly chainHash: Buffer; readonly peer: IMessageSender; readonly logger: ILogger; private _state; private _firstTimestamp; private _timestampRange; constructor(chainHash: Buffer, peer: IMessageSender, logger: ILogger); get state(): GossipQueriesReceiverState; get firstTimestamp(): number; get timestampRange(): number; /** * Deactivates gossip with the remote peer by sending a * gossip_timestamp_filter message that disables broadcast. In particular this * message will use a first_timestamp of uint32_max and a timestamp_range of * 0 to prevent the remote peer from sending information. */ deactivate(): void; /** * Activates gossip with the remote peer by sending a gossip_timestamp_filter * message with the specified first timestamp and range. By default, this * starts gossip with the current timestamp and uint32_max as the range. * @param start * @param range */ activate(start?: number, range?: number): void; }