Skip to content

Commit

Permalink
VERBOSE=1 node build/src/jerboaChallenge.js __tests__/fixtures/sarafu…
Browse files Browse the repository at this point in the history
…-10k.csv > debug.out
  • Loading branch information
michielbdejong committed Oct 25, 2024
1 parent 0defa31 commit d348ce8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Jerboa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class Jerboa {
this.adjustReceived(sender, msg.amount);
this.checkFriendCache(sender);
if (this.balances.haveIncomingAndOutgoingLinks()) {
this.debug(`transfer receiver starts probe`);
this.debug(`transfer receiver ${this.name} starts probe`);
this.startProbe();
}
// if (this.graph.getNode(this.name).getBalance(sender) + this.graph.getNode(sender).getBalance(this.name) !== 0) {
Expand Down Expand Up @@ -566,12 +566,15 @@ export class Jerboa {
this.debug(`transfer ${this.name} -> ${to}`);
}
startProbe(): void {
this.debug(`SEMAPHORE REQ ${this.name}`);
this.semaphoreService.joinQueue(async () => {
const probeId = `${this.name}-${this.probeMinter++}`;
this.debug(`$SEMAPHORE GO ${probeId}`);
this.debug(`${this.name} starts probe ${probeId}`);
const promise = new Promise(resolve => this.whenDone = resolve);
this.runProbe({ sender: null, probeId, incarnation: 0, debugInfo: { path: [], backtracked: [] } });
await promise;
this.debug(`SEMAPHORE DONE ${probeId}`);
});
}
runProbe(probeInfo: ProbeInfo): void {
Expand Down

0 comments on commit d348ce8

Please sign in to comment.