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