Skip to content

Commit

Permalink
chore: revert change to process queue
Browse files Browse the repository at this point in the history
  • Loading branch information
r4mmer committed Oct 26, 2023
1 parent f4c3daf commit 203565a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/new/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ class HathorWallet extends EventEmitter {
wsData = this.wsTxQueue.dequeue();
// We should release the event loop for other threads
// This effectively awaits 0 seconds, but it schedule the next iteration to run after other threads.
await new Promise(resolve => { setTimeout(resolve, 0) });
await new Promise(resolve => { setTimeout(resolve, 0); });
}
}

Expand All @@ -1186,10 +1186,8 @@ class HathorWallet extends EventEmitter {
* @returns {Promise} A promise that resolves when the wallet is done processing the tx queue.
*/
async onEnterStateProcessing() {
// Started processing state now
// Process the queue of transactions received until now
// and then resume with the correct state
return this.processTxQueue()
// Started processing state now, so we prepare the local data to support using this facade interchangable with wallet service facade in both wallets
return this.storage.processHistory()
.then(() => { this.setState(HathorWallet.READY); })
.catch(() => { this.setState(HathorWallet.ERROR); });
}
Expand Down Expand Up @@ -1276,7 +1274,7 @@ class HathorWallet extends EventEmitter {
* Optional but required if not set in this
*
* @return {Promise<Transaction>} Promise that resolves when transaction is sent
**/
*/
async sendManyOutputsTransaction(outputs, options = {}) {
if (await this.storage.isReadonly()) {
throw new WalletFromXPubGuard('sendManyOutputsTransaction');
Expand Down Expand Up @@ -1313,7 +1311,7 @@ class HathorWallet extends EventEmitter {
* 'pinCode': pin to decrypt xpriv information. Required if not set in object.
* 'password': password to decrypt xpriv information. Required if not set in object.
* }
**/
*/
async start(optionsParams = {}) {
const options = Object.assign({ pinCode: null, password: null }, optionsParams);
const pinCode = options.pinCode || this.pinCode;
Expand Down

0 comments on commit 203565a

Please sign in to comment.