Remove unnecessary async
This commit is contained in:
parent
d4223ce604
commit
19da967605
@ -504,15 +504,15 @@ export default class Services {
|
||||
await db.clearStore('diffs');
|
||||
}
|
||||
|
||||
async sendNewTxMessage(message: string) {
|
||||
sendNewTxMessage(message: string) {
|
||||
sendMessage('NewTx', message);
|
||||
}
|
||||
|
||||
async sendCommitMessage(message: string) {
|
||||
sendCommitMessage(message: string) {
|
||||
sendMessage('Commit', message);
|
||||
}
|
||||
|
||||
async sendCipherMessages(ciphers: string[]) {
|
||||
sendCipherMessages(ciphers: string[]) {
|
||||
for (let i = 0; i < ciphers.length; i++) {
|
||||
const cipher = ciphers[i];
|
||||
sendMessage('Cipher', cipher);
|
||||
@ -603,7 +603,7 @@ export default class Services {
|
||||
}
|
||||
|
||||
if (apiReturn.new_tx_to_send && apiReturn.new_tx_to_send.transaction.length != 0) {
|
||||
await this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send));
|
||||
this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send));
|
||||
await new Promise(r => setTimeout(r, 500));
|
||||
}
|
||||
|
||||
@ -677,11 +677,11 @@ export default class Services {
|
||||
|
||||
if (apiReturn.commit_to_send) {
|
||||
const commit = apiReturn.commit_to_send;
|
||||
await this.sendCommitMessage(JSON.stringify(commit));
|
||||
this.sendCommitMessage(JSON.stringify(commit));
|
||||
}
|
||||
|
||||
if (apiReturn.ciphers_to_send && apiReturn.ciphers_to_send.length != 0) {
|
||||
await this.sendCipherMessages(apiReturn.ciphers_to_send);
|
||||
this.sendCipherMessages(apiReturn.ciphers_to_send);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1545,7 +1545,7 @@ export default class Services {
|
||||
if (dontRetry.includes(errorMsg)) { return; }
|
||||
// Wait and retry
|
||||
setTimeout(async () => {
|
||||
await this.sendCommitMessage(JSON.stringify(content));
|
||||
this.sendCommitMessage(JSON.stringify(content));
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user