Skip to content

Commit 9f55a5c

Browse files
committed
Cuckoo Filter Upgrade
1 parent 04c57ab commit 9f55a5c

File tree

10 files changed

+312
-361
lines changed

10 files changed

+312
-361
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ js-offs-darwin-x64.zip
1717
js-offs-linux-x64.zip
1818
js-offs-linux-ia32.zip
1919
/dist
20-
20+
/src/electron/views/**/index.js

package-lock.json

+43-90
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"cbor-js": "^0.1.0",
9292
"collect-stream": "^1.2.1",
9393
"commander": "2.19.0",
94-
"cuckoo-filter": "1.1.1",
94+
"cuckoo-filter": "^1.1.3",
9595
"electron-context-menu": "^0.10.1",
9696
"electron-ipc-responder": "1.0.4",
9797
"end-of-stream": "^1.4.1",

src/block-cache-cluster.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ if (cluster.isMaster) {
2626
pool.set(worker.id, worker)
2727
worker.once('exit', () => {
2828
pool.delete(worker.id)
29+
let cb = _callbacks.get(this)
30+
if (cb) {
31+
return cb(new Error('Worker Exited Unexpectedly'))
32+
}
2933
return spawnWorker()
3034
})
3135
worker.on('message', (msg) => {
@@ -120,7 +124,7 @@ if (cluster.isMaster) {
120124
}
121125
}
122126
} else {
123-
var workerData = { path: process.argv[2], bucketSize: +process.argv[3], fingerprintSize: +process.argv[4]}
127+
var workerData = {path: process.argv[2], bucketSize: +process.argv[3], fingerprintSize: +process.argv[4]}
124128
process.on('message', (msg) => {
125129
switch(msg.type) {
126130
case type.content :
@@ -173,6 +177,7 @@ if (cluster.isMaster) {
173177
for (let i = 0; i < content.length; i++) {
174178
filter.add(content[ i ])
175179
}
180+
let filter2 = CuckooFilter.fromCBOR(filter.toCBOR())
176181
return cb(err, filter.toCBOR())
177182
} catch (err){
178183
return cb(err)

src/block-cache.js

-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ module.exports =
190190
let gatherTemporaries = _gatherTemporaries.get(this)
191191
let temps = gatherTemporaries()
192192
let bcw = _bcw.get(this)
193-
194193
bcw.contentFilter(temps, (err, contentFilter) => {
195194
if (!err) {
196195
_contentFilter.set(this, contentFilter)

src/electron/views/configuration/index.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -16302,7 +16302,7 @@ exports.insert = function (css) {
1630216302
}
1630316303

1630416304
},{}],8:[function(require,module,exports){
16305-
var __vueify_style_dispose__ = require("vueify/lib/insert-css").insert(".main[data-v-f3da1f96] {\n min-width: 800px;\n}")
16305+
var __vueify_style_dispose__ = require("vueify/lib/insert-css").insert(".main[data-v-2b25cc58] {\n min-width: 800px;\n}")
1630616306
;(function(){
1630716307
//
1630816308
//
@@ -16446,16 +16446,16 @@ var __vue__options__ = (typeof module.exports === "function"? module.exports.opt
1644616446
if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")}
1644716447
__vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"columns"},[_c('div',{staticClass:"column"}),_vm._v(" "),_c('div',{staticClass:"column main"},[(_vm.peers.length)?_c('table',{staticClass:"table is-bordered is-striped is-narrow is-hoverable is-fullwidth"},[_vm._m(0),_vm._v(" "),_c('tbody',_vm._l((_vm.peers),function(peer,index){return _c('tr',[_c('td',[_vm._v(_vm._s(peer.key))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(peer.ip))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(peer.port))]),_vm._v(" "),_c('td',[_c('i',{staticClass:"fa fa-times-circle",attrs:{"aria-hidden":"true"},on:{"click":function($event){_vm.remove(index)}}})])])}))]):_vm._e(),_vm._v(" "),_c('div',[_c('label',{staticClass:"checkbox"},[_vm._v("\n Bootstrap to last known connections?\n "),_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.lastKnownPeers),expression:"lastKnownPeers"}],attrs:{"type":"checkbox"},domProps:{"checked":Array.isArray(_vm.lastKnownPeers)?_vm._i(_vm.lastKnownPeers,null)>-1:(_vm.lastKnownPeers)},on:{"click":_vm.check,"change":function($event){var $$a=_vm.lastKnownPeers,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.lastKnownPeers=$$a.concat([$$v]))}else{$$i>-1&&(_vm.lastKnownPeers=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.lastKnownPeers=$$c}}}})])]),_vm._v(" "),_c('hr'),_vm._v(" "),_c('form',{on:{"submit":function($event){$event.preventDefault();return _vm.add($event)}}},[_c('div',{staticClass:"column"},[_c('div',{staticClass:"field"},[_c('label',{staticClass:"label"},[_vm._v("Locator")]),_vm._v(" "),_c('div',{staticClass:"control has-icons-left has-icons-right"},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.locator),expression:"locator"}],staticClass:" input is-success",attrs:{"type":"text","placeholder":"locator","name":"locator"},domProps:{"value":(_vm.locator)},on:{"input":function($event){if($event.target.composing){ return; }_vm.locator=$event.target.value}}}),_vm._v(" "),_vm._m(1)]),_vm._v(" "),_c('p',{directives:[{name:"show",rawName:"v-show",value:(_vm.locatorErr),expression:"locatorErr"}],staticClass:"help is-danger"},[_vm._v("Invalid Locator")])]),_vm._v(" "),_c('div',{staticClass:"control"},[(_vm.success)?_c('span',{staticClass:"message is-sucess"},[_vm._v("Success")]):_vm._e(),_vm._v(" "),(_vm.configuratorErr)?_c('span',{staticClass:"message is-danger"},[_vm._v(_vm._s(_vm.configuratorErr))]):_vm._e(),_vm._v(" "),_c('input',{staticClass:"button is-primary",staticStyle:{"float":"right"},attrs:{"type":"submit","value":"Add"}})])])])]),_vm._v(" "),_c('div',{staticClass:"column"})])])}
1644816448
__vue__options__.staticRenderFns = [function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('thead',[_c('tr',[_c('td',[_vm._v("Node ID")]),_vm._v(" "),_c('td',[_vm._v("IP Address")]),_vm._v(" "),_c('td',[_vm._v("Port")]),_vm._v(" "),_c('td',[_vm._v("Remove")])])])},function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"icon is-small is-left"},[_c('i',{staticClass:"fa fa-globe"})])}]
16449-
__vue__options__._scopeId = "data-v-f3da1f96"
16449+
__vue__options__._scopeId = "data-v-2b25cc58"
1645016450
if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api")
1645116451
hotAPI.install(require("vue"), true)
1645216452
if (!hotAPI.compatible) return
1645316453
module.hot.accept()
1645416454
module.hot.dispose(__vueify_style_dispose__)
1645516455
if (!module.hot.data) {
16456-
hotAPI.createRecord("data-v-f3da1f96", __vue__options__)
16456+
hotAPI.createRecord("data-v-2b25cc58", __vue__options__)
1645716457
} else {
16458-
hotAPI.reload("data-v-f3da1f96", __vue__options__)
16458+
hotAPI.reload("data-v-2b25cc58", __vue__options__)
1645916459
}
1646016460
})()}
1646116461
},{"vue":6,"vue-hot-reload-api":4,"vueify/lib/insert-css":7}],9:[function(require,module,exports){
@@ -16545,9 +16545,9 @@ if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api")
1654516545
module.hot.accept()
1654616546
module.hot.dispose(__vueify_style_dispose__)
1654716547
if (!module.hot.data) {
16548-
hotAPI.createRecord("data-v-4355633d", __vue__options__)
16548+
hotAPI.createRecord("data-v-3533a55c", __vue__options__)
1654916549
} else {
16550-
hotAPI.reload("data-v-4355633d", __vue__options__)
16550+
hotAPI.reload("data-v-3533a55c", __vue__options__)
1655116551
}
1655216552
})()}
1655316553
},{"vue":6,"vue-hot-reload-api":4,"vueify/lib/insert-css":7}],10:[function(require,module,exports){
@@ -16714,9 +16714,9 @@ if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api")
1671416714
if (!hotAPI.compatible) return
1671516715
module.hot.accept()
1671616716
if (!module.hot.data) {
16717-
hotAPI.createRecord("data-v-65905bb5", __vue__options__)
16717+
hotAPI.createRecord("data-v-23566114", __vue__options__)
1671816718
} else {
16719-
hotAPI.reload("data-v-65905bb5", __vue__options__)
16719+
hotAPI.reload("data-v-23566114", __vue__options__)
1672016720
}
1672116721
})()}
1672216722
},{"vue":6,"vue-hot-reload-api":4}],12:[function(require,module,exports){
@@ -16933,9 +16933,9 @@ if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api")
1693316933
module.hot.accept()
1693416934
module.hot.dispose(__vueify_style_dispose__)
1693516935
if (!module.hot.data) {
16936-
hotAPI.createRecord("data-v-8c2f54fc", __vue__options__)
16936+
hotAPI.createRecord("data-v-77ae5ae1", __vue__options__)
1693716937
} else {
16938-
hotAPI.reload("data-v-8c2f54fc", __vue__options__)
16938+
hotAPI.reload("data-v-77ae5ae1", __vue__options__)
1693916939
}
1694016940
})()}
1694116941
},{"vue":6,"vue-hot-reload-api":4,"vueify/lib/insert-css":7}]},{},[10]);

src/electron/views/connect/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -8572,7 +8572,7 @@ exports.insert = function (css) {
85728572
}
85738573

85748574
},{}],6:[function(require,module,exports){
8575-
var __vueify_style_dispose__ = require("vueify/lib/insert-css").insert(".form[data-v-36cd93b6] {\n padding: 0 20px 0 20px;\n}")
8575+
var __vueify_style_dispose__ = require("vueify/lib/insert-css").insert(".form[data-v-4dba7104] {\n padding: 0 20px 0 20px;\n}")
85768576
;(function(){
85778577
//
85788578
//
@@ -8643,16 +8643,16 @@ var __vue__options__ = (typeof module.exports === "function"? module.exports.opt
86438643
if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")}
86448644
__vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('form',{staticClass:"form",staticStyle:{"overflow":"hidden"},on:{"submit":function($event){$event.preventDefault();return _vm.connect($event)}}},[_c('div',{staticClass:"column"},[_c('div',{staticClass:"field"},[_c('label',{staticClass:"label"},[_vm._v("Locator")]),_vm._v(" "),_c('div',{staticClass:"control has-icons-left has-icons-right"},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.locator),expression:"locator"}],staticClass:" input is-success",attrs:{"type":"text","placeholder":"locator","name":"locator"},domProps:{"value":(_vm.locator)},on:{"input":function($event){if($event.target.composing){ return; }_vm.locator=$event.target.value}}}),_vm._v(" "),_vm._m(0)]),_vm._v(" "),_c('p',{directives:[{name:"show",rawName:"v-show",value:(_vm.locatorErr),expression:"locatorErr"}],staticClass:"help is-danger"},[_vm._v("Invalid Locator")])]),_vm._v(" "),_c('div',{staticClass:"control"},[(_vm.success)?_c('span',{staticClass:"message is-sucess"},[_vm._v("Success")]):_vm._e(),_vm._v(" "),(_vm.connectErr)?_c('span',{staticClass:"message is-danger"},[_vm._v(_vm._s(_vm.connectErr))]):_vm._e(),_vm._v(" "),_c('input',{staticClass:"button is-primary",staticStyle:{"float":"right"},attrs:{"type":"submit","disabled":_vm.connecting,"value":"Connect"}})])])])}
86458645
__vue__options__.staticRenderFns = [function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"icon is-small is-left"},[_c('i',{staticClass:"fa fa-globe"})])}]
8646-
__vue__options__._scopeId = "data-v-36cd93b6"
8646+
__vue__options__._scopeId = "data-v-4dba7104"
86478647
if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api")
86488648
hotAPI.install(require("vue"), true)
86498649
if (!hotAPI.compatible) return
86508650
module.hot.accept()
86518651
module.hot.dispose(__vueify_style_dispose__)
86528652
if (!module.hot.data) {
8653-
hotAPI.createRecord("data-v-36cd93b6", __vue__options__)
8653+
hotAPI.createRecord("data-v-4dba7104", __vue__options__)
86548654
} else {
8655-
hotAPI.reload("data-v-36cd93b6", __vue__options__)
8655+
hotAPI.reload("data-v-4dba7104", __vue__options__)
86568656
}
86578657
})()}
86588658
},{"vue":4,"vue-hot-reload-api":3,"vueify/lib/insert-css":5}],7:[function(require,module,exports){

0 commit comments

Comments
 (0)