diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-05-25 21:30:48 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-05-25 21:30:48 +0200 |
commit | cb531beaef868dd75aa625e1f881a0304d7355c4 (patch) | |
tree | 2745a64155d8f44c2a40097e259ede2c96936ae9 /lib/wallet | |
parent | 34b65e2ef704fdc4b8c1c24ec86303a75f7ca59d (diff) |
don't start transaction if there is no work
Diffstat (limited to 'lib/wallet')
-rw-r--r-- | lib/wallet/query.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/wallet/query.ts b/lib/wallet/query.ts index d5ec1fecc..b4f9c511b 100644 --- a/lib/wallet/query.ts +++ b/lib/wallet/query.ts @@ -357,6 +357,10 @@ class QueryRoot { return this.kickoffPromise; } this.kickoffPromise = new Promise((resolve, reject) => { + if (this.work.length == 0) { + resolve(); + return; + } const mode = this.hasWrite ? "readwrite" : "readonly"; const tx = this.db.transaction(Array.from(this.stores), mode); tx.oncomplete = () => { |