use native buffer methods if possible.
This commit is contained in:
parent
661bd06e3e
commit
85af68d2ef
@ -97,6 +97,7 @@ Fullnode.prototype._init = function _init() {
|
|||||||
self.emit('error', err);
|
self.emit('error', err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (0)
|
||||||
this.on('tx', function(tx) {
|
this.on('tx', function(tx) {
|
||||||
self.walletdb.addTX(tx, function(err) {
|
self.walletdb.addTX(tx, function(err) {
|
||||||
if (err)
|
if (err)
|
||||||
@ -117,6 +118,7 @@ Fullnode.prototype._init = function _init() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Update the mempool.
|
// Update the mempool.
|
||||||
|
if (0)
|
||||||
this.chain.on('add block', function(block) {
|
this.chain.on('add block', function(block) {
|
||||||
self.mempool.addBlock(block, function(err) {
|
self.mempool.addBlock(block, function(err) {
|
||||||
if (err)
|
if (err)
|
||||||
@ -124,6 +126,7 @@ Fullnode.prototype._init = function _init() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (0)
|
||||||
this.chain.on('remove block', function(block) {
|
this.chain.on('remove block', function(block) {
|
||||||
self.mempool.removeBlock(block, function(err) {
|
self.mempool.removeBlock(block, function(err) {
|
||||||
if (err)
|
if (err)
|
||||||
|
|||||||
@ -420,6 +420,9 @@ utils.isEqual = function isEqual(a, b) {
|
|||||||
if (a.length !== b.length)
|
if (a.length !== b.length)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (a.compare)
|
||||||
|
return a.compare(b) === 0;
|
||||||
|
|
||||||
for (i = 0; i < a.length; i++) {
|
for (i = 0; i < a.length; i++) {
|
||||||
if (a[i] !== b[i])
|
if (a[i] !== b[i])
|
||||||
return false;
|
return false;
|
||||||
@ -1520,8 +1523,12 @@ utils.sizeVarint = function sizeVarint(num) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
utils.cmp = function(a, b) {
|
utils.cmp = function(a, b) {
|
||||||
var len = Math.min(a.length, b.length);
|
var len, i;
|
||||||
var i;
|
|
||||||
|
if (a.compare)
|
||||||
|
return a.compare(b);
|
||||||
|
|
||||||
|
len = Math.min(a.length, b.length);
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
if (a[i] < b[i])
|
if (a[i] < b[i])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user