diff --git a/packages/indy-vdr/src/pool/IndyVdrPool.ts b/packages/indy-vdr/src/pool/IndyVdrPool.ts index e2d3a8c57e..17de8df670 100644 --- a/packages/indy-vdr/src/pool/IndyVdrPool.ts +++ b/packages/indy-vdr/src/pool/IndyVdrPool.ts @@ -41,6 +41,7 @@ export interface IndyVdrPoolConfig { export class IndyVdrPool { private _pool?: indyVdrPool + private _archievedPool?: indyVdrPool private poolConfig: IndyVdrPoolConfig public authorAgreement?: AuthorAgreement | null @@ -61,6 +62,12 @@ export class IndyVdrPool { throw new IndyVdrError('Cannot connect to pool, already connected.') } + if (this._archievedPool) { + this._pool = this._archievedPool + this._archievedPool = undefined + return + } + this._pool = new PoolCreate({ parameters: { transactions: this.config.genesisTransactions, @@ -96,8 +103,11 @@ export class IndyVdrPool { throw new IndyVdrError("Can't close pool. Pool is not connected") } - // FIXME: this method doesn't work?? + // FIXME: Currently, the close method is not working coorectly in the indy-vdr-shared package // this.pool.close() + // Hence, a workaround to reset the _pool + this._archievedPool = this._pool + this._pool = undefined } public async prepareWriteRequest(