Compare commits
3 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 8993ba67d4 | |
Derrick Hammer | fd3d5facac | |
Derrick Hammer | 09637948e7 |
|
@ -1,3 +1,10 @@
|
||||||
|
# [0.1.0-develop.64](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.63...v0.1.0-develop.64) (2023-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* wrap sync in try/catch and unlock mutex in a finally ([0963794](https://git.lumeweb.com/LumeWeb/libethsync/commit/09637948e71e88c66b9e40389b4a46c60659f6e3))
|
||||||
|
|
||||||
# [0.1.0-develop.63](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.62...v0.1.0-develop.63) (2023-10-24)
|
# [0.1.0-develop.63](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.62...v0.1.0-develop.63) (2023-10-24)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libethsync",
|
"name": "@lumeweb/libethsync",
|
||||||
"version": "0.1.0-develop.63",
|
"version": "0.1.0-develop.64",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/libethsync",
|
"name": "@lumeweb/libethsync",
|
||||||
"version": "0.1.0-develop.63",
|
"version": "0.1.0-develop.64",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chainsafe/as-sha256": "^0.3.1",
|
"@chainsafe/as-sha256": "^0.3.1",
|
||||||
"@chainsafe/bls": "7.1.1",
|
"@chainsafe/bls": "7.1.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libethsync",
|
"name": "@lumeweb/libethsync",
|
||||||
"version": "0.1.0-develop.63",
|
"version": "0.1.0-develop.64",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -170,18 +170,22 @@ export default abstract class BaseClient extends EventEmitter {
|
||||||
protected async _sync() {
|
protected async _sync() {
|
||||||
await this.syncMutex.acquire();
|
await this.syncMutex.acquire();
|
||||||
|
|
||||||
const currentPeriod = this.getCurrentPeriod();
|
try {
|
||||||
if (currentPeriod > this._latestPeriod) {
|
const currentPeriod = this.getCurrentPeriod();
|
||||||
if (!this.booted) {
|
if (currentPeriod > this._latestPeriod) {
|
||||||
this.latestCommittee = await this.syncFromGenesis();
|
if (!this.booted) {
|
||||||
} else {
|
this.latestCommittee = await this.syncFromGenesis();
|
||||||
this.latestCommittee = await this.syncFromLastUpdate();
|
} else {
|
||||||
|
this.latestCommittee = await this.syncFromLastUpdate();
|
||||||
|
}
|
||||||
|
this._latestPeriod = currentPeriod;
|
||||||
|
this.emit("synced");
|
||||||
}
|
}
|
||||||
this._latestPeriod = currentPeriod;
|
} catch (e) {
|
||||||
this.emit("synced");
|
console.log(e);
|
||||||
|
} finally {
|
||||||
|
this.syncMutex.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.syncMutex.release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async subscribe(callback?: (ei: ExecutionInfo) => void) {
|
protected async subscribe(callback?: (ei: ExecutionInfo) => void) {
|
||||||
|
|
Loading…
Reference in New Issue