db: do not use isBrowser for bufferKeys check. see #137.
This commit is contained in:
parent
7bd89b35c3
commit
29fe6468eb
@ -2334,7 +2334,7 @@ function ChainOptions(options) {
|
|||||||
this.maxFiles = 64;
|
this.maxFiles = 64;
|
||||||
this.cacheSize = 32 << 20;
|
this.cacheSize = 32 << 20;
|
||||||
this.compression = true;
|
this.compression = true;
|
||||||
this.bufferKeys = !util.isBrowser;
|
this.bufferKeys = ChainDB.layout.binary;
|
||||||
|
|
||||||
this.spv = false;
|
this.spv = false;
|
||||||
this.prune = false;
|
this.prune = false;
|
||||||
|
|||||||
@ -11,6 +11,7 @@ var pad8 = util.pad8;
|
|||||||
var pad32 = util.pad32;
|
var pad32 = util.pad32;
|
||||||
|
|
||||||
var layout = {
|
var layout = {
|
||||||
|
binary: false,
|
||||||
R: 'R',
|
R: 'R',
|
||||||
O: 'O',
|
O: 'O',
|
||||||
V: 'v',
|
V: 'v',
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var layout = {
|
var layout = {
|
||||||
|
binary: true,
|
||||||
R: new Buffer([0x52]),
|
R: new Buffer([0x52]),
|
||||||
O: new Buffer([0x4f]),
|
O: new Buffer([0x4f]),
|
||||||
V: new Buffer([0x76]),
|
V: new Buffer([0x76]),
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var layout = {
|
var layout = {
|
||||||
|
binary: false,
|
||||||
R: 'R',
|
R: 'R',
|
||||||
V: 'V',
|
V: 'V',
|
||||||
e: function e(hash) {
|
e: function e(hash) {
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var layout = {
|
var layout = {
|
||||||
|
binary: true,
|
||||||
R: new Buffer([0x52]),
|
R: new Buffer([0x52]),
|
||||||
V: new Buffer([0x76]),
|
V: new Buffer([0x76]),
|
||||||
e: function e(hash) {
|
e: function e(hash) {
|
||||||
|
|||||||
@ -1929,7 +1929,7 @@ function MempoolOptions(options) {
|
|||||||
this.maxFiles = 64;
|
this.maxFiles = 64;
|
||||||
this.cacheSize = 32 << 20;
|
this.cacheSize = 32 << 20;
|
||||||
this.compression = true;
|
this.compression = true;
|
||||||
this.bufferKeys = !util.isBrowser;
|
this.bufferKeys = layout.binary;
|
||||||
|
|
||||||
this.persistent = false;
|
this.persistent = false;
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ var pad32 = util.pad32;
|
|||||||
var layouts = exports;
|
var layouts = exports;
|
||||||
|
|
||||||
layouts.walletdb = {
|
layouts.walletdb = {
|
||||||
|
binary: false,
|
||||||
p: function p(hash) {
|
p: function p(hash) {
|
||||||
return 'p' + hash;
|
return 'p' + hash;
|
||||||
},
|
},
|
||||||
@ -72,6 +73,7 @@ layouts.walletdb = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
layouts.txdb = {
|
layouts.txdb = {
|
||||||
|
binary: false,
|
||||||
prefix: function prefix(wid, key) {
|
prefix: function prefix(wid, key) {
|
||||||
return 't' + pad32(wid) + key;
|
return 't' + pad32(wid) + key;
|
||||||
},
|
},
|
||||||
|
|||||||
@ -26,6 +26,7 @@ var layouts = exports;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
layouts.walletdb = {
|
layouts.walletdb = {
|
||||||
|
binary: true,
|
||||||
p: function p(hash) {
|
p: function p(hash) {
|
||||||
var key = new Buffer(1 + (hash.length / 2));
|
var key = new Buffer(1 + (hash.length / 2));
|
||||||
key[0] = 0x70;
|
key[0] = 0x70;
|
||||||
@ -149,6 +150,7 @@ layouts.walletdb = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
layouts.txdb = {
|
layouts.txdb = {
|
||||||
|
binary: true,
|
||||||
prefix: function prefix(wid, key) {
|
prefix: function prefix(wid, key) {
|
||||||
var out = new Buffer(5 + key.length);
|
var out = new Buffer(5 + key.length);
|
||||||
out[0] = 0x74;
|
out[0] = 0x74;
|
||||||
|
|||||||
@ -2166,7 +2166,7 @@ function WalletOptions(options) {
|
|||||||
this.maxFiles = 64;
|
this.maxFiles = 64;
|
||||||
this.cacheSize = 16 << 20;
|
this.cacheSize = 16 << 20;
|
||||||
this.compression = true;
|
this.compression = true;
|
||||||
this.bufferKeys = !util.isBrowser;
|
this.bufferKeys = layout.binary;
|
||||||
|
|
||||||
this.spv = false;
|
this.spv = false;
|
||||||
this.witness = false;
|
this.witness = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user