Skip to content

Commit

Permalink
refactor(core-forger): split start into register and boot
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Faust committed Nov 13, 2019
1 parent 3131db9 commit 6fe1e1e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/core-forger/src/service-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ export class ServiceProvider extends Providers.ServiceProvider {

forgerManager.init(this.config().all());

await forgerManager.startForging(this.config().get("bip38"), this.config().get("password"));
this.app.bind("forger").toConstantValue(forgerManager);
}

public async boot(): Promise<void> {
await this.app
.get<ForgerManager>("forger")
.startForging(this.config().get("bip38"), this.config().get("password"));

// Don't keep bip38 password in memory
this.config().set("bip38", undefined);
this.config().set("password", undefined);

this.app.bind("forger").toConstantValue(forgerManager);
}

public async dispose(): Promise<void> {
Expand Down

0 comments on commit 6fe1e1e

Please sign in to comment.