await for mempool change handler after loading disk cache

This commit is contained in:
Mononaut
2023-04-30 13:59:29 -06:00
parent 2d8dea6c2b
commit e6a23567e0
4 changed files with 6 additions and 6 deletions

View File

@@ -80,13 +80,13 @@ class Mempool {
return this.mempoolCache;
}
public setMempool(mempoolData: { [txId: string]: TransactionExtended }) {
public async setMempool(mempoolData: { [txId: string]: TransactionExtended }) {
this.mempoolCache = mempoolData;
if (this.mempoolChangedCallback) {
this.mempoolChangedCallback(this.mempoolCache, [], []);
}
if (this.asyncMempoolChangedCallback) {
this.asyncMempoolChangedCallback(this.mempoolCache, [], []);
await this.asyncMempoolChangedCallback(this.mempoolCache, [], []);
}
}