aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-05-25 21:30:48 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-05-25 21:30:48 +0200
commitcb531beaef868dd75aa625e1f881a0304d7355c4 (patch)
tree2745a64155d8f44c2a40097e259ede2c96936ae9 /lib
parent34b65e2ef704fdc4b8c1c24ec86303a75f7ca59d (diff)
don't start transaction if there is no work
Diffstat (limited to 'lib')
-rw-r--r--lib/wallet/query.ts4
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 = () => {