From b26961d68aa13cb229a19f38b3cf8930476f35c9 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 3 Apr 2016 03:32:27 -0700 Subject: [PATCH] prevent infinite loop on circular references. --- lib/bcoin/ldb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bcoin/ldb.js b/lib/bcoin/ldb.js index 8615bb67..83de5249 100644 --- a/lib/bcoin/ldb.js +++ b/lib/bcoin/ldb.js @@ -136,7 +136,7 @@ function LowlevelUp(file, options) { // Stay as close to the metal as possible. // We want to make calls to C++ directly. - while (this.db.db && this.db.db.put) + while (this.db.db && this.db.db.put && this.db.db !== this.db) this.db = this.db.db; this.binding = this.db;