import { BlockDTO } from "../dto/BlockDTO"; import { DBBlock } from "../db/DBBlock"; import { Map } from "../common-libs/crypto/map"; export declare class BlockchainContext { private conf; private dal; private logger; /** * The virtual next HEAD. Computed each time a new block is added, because a lot of HEAD variables are deterministic * and can be computed one, just after a block is added for later controls. */ private vHEAD; /** * The currently written HEAD, aka. HEAD_1 relatively to incoming HEAD. */ private vHEAD_1; private HEADrefreshed; /** * Refresh the virtual HEAD value for determined variables of the next coming block, avoiding to recompute them * each time a new block arrives to check if the values are correct. We can know and store them early on, in vHEAD. */ private refreshHead; /** * Gets a copy of vHEAD, extended with some extra properties. * @param props The extra properties to add. */ getvHeadCopy(props?: any): Promise; /** * Get currently written HEAD. */ getvHEAD_1(): Promise; /** * Utility method: gives the personalized difficulty level of a given issuer for next block. * @param issuer The issuer we want to get the difficulty level. */ getIssuerPersonalizedDifficulty(issuer: string): Promise; setConfDAL(newConf: any, newDAL: any): void; checkBlock(block: BlockDTO, withPoWAndSignature: boolean, ignoreIssuer: boolean): Promise; private addBlock; addSideBlock(obj: BlockDTO): Promise; revertCurrentBlock(): Promise; revertCurrentHead(): Promise; applyNextAvailableFork(): Promise; checkAndAddBlock(block: BlockDTO, trim?: boolean): Promise; current(): Promise; checkHaveEnoughLinks(target: string, newLinks: Map): Promise; }