network/fees: minor.

This commit is contained in:
Christopher Jeffrey 2017-11-04 11:39:00 -07:00
parent 8dbf7e8ba2
commit 3c3f6b953c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 9 additions and 9 deletions

View File

@ -861,8 +861,8 @@ DoubleMap.prototype.insert = function insert(key, value) {
};
DoubleMap.prototype.search = function search(key) {
const i = binary.search(this.buckets, key, compare, true);
assert(this.buckets.length !== 0, 'Cannot search.');
const i = binary.search(this.buckets, key, compare, true);
return this.buckets[i][1];
};

View File

@ -792,7 +792,7 @@ MTX.prototype.signVector = function signVector(prev, vector, sig, ring) {
for (let i = 1; i < vector.length; i++) {
const item = vector.get(i);
if (item.length > 0)
total++;
total += 1;
}
// Signatures are already finalized.
@ -833,7 +833,7 @@ MTX.prototype.signVector = function signVector(prev, vector, sig, ring) {
// Offset key index by one to turn it into
// "sig index". Accounts for OP_0 byte at
// the start.
keyIndex++;
keyIndex += 1;
// Add our signature to the correct slot
// and increment the total number of
@ -841,7 +841,7 @@ MTX.prototype.signVector = function signVector(prev, vector, sig, ring) {
if (keyIndex < vector.length && total < m) {
if (vector.get(keyIndex).length === 0) {
vector.set(keyIndex, sig);
total++;
total += 1;
}
}
@ -858,7 +858,7 @@ MTX.prototype.signVector = function signVector(prev, vector, sig, ring) {
// This should never happen.
while (total > m) {
vector.pop();
total--;
total -= 1;
}
// Sanity checks.
@ -1026,7 +1026,7 @@ MTX.prototype.template = function template(ring) {
if (!this.scriptInput(i, coin, ring))
continue;
total++;
total += 1;
}
return total;
@ -1070,7 +1070,7 @@ MTX.prototype.sign = function sign(ring, type) {
if (!this.signInput(i, coin, ring, type))
continue;
total++;
total += 1;
}
return total;

View File

@ -97,13 +97,13 @@ Network.prototype.init = function init() {
bits |= consensus.VERSION_TOP_MASK;
this.unknownBits = ~bits;
this.unknownBits = ~bits >>> 0;
for (const key of Object.keys(this.checkpointMap)) {
const hash = this.checkpointMap[key];
const height = Number(key);
this.checkpoints.push({ hash: hash, height: height });
this.checkpoints.push({ hash, height });
}
this.checkpoints.sort(cmpNode);