consistency.

This commit is contained in:
Christopher Jeffrey 2016-06-04 19:37:15 -07:00
parent af33e61031
commit 10efd549ce
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 20 additions and 13 deletions

View File

@ -1263,8 +1263,8 @@ Chain.prototype._setBestChain = function _setBestChain(entry, block, prev, callb
Chain.prototype.reset = function reset(height, callback, force) {
var self = this;
var unlock = this._lock(reset, [height, callback], force);
if (!unlock)
return;
@ -1294,8 +1294,8 @@ Chain.prototype.reset = function reset(height, callback, force) {
Chain.prototype.resetTime = function resetTime(ts, callback, force) {
var self = this;
var unlock = this._lock(resetTime, [ts, callback], force);
if (!unlock)
return;
@ -1341,10 +1341,12 @@ Chain.prototype.add = function add(block, callback, force) {
var self = this;
var total = 0;
var ret = {};
var unlock;
assert(this.loaded);
var unlock = this._lock(add, [block, callback], force);
unlock = this._lock(add, [block, callback], force);
if (!unlock)
return;
@ -1888,9 +1890,10 @@ Chain.prototype.getLocator = function getLocator(start, callback, force) {
var self = this;
var hashes = [];
var step = 1;
var height;
var unlock, height;
unlock = this._lock(getLocator, [start, callback], force);
var unlock = this._lock(getLocator, [start, callback], force);
if (!unlock)
return;

View File

@ -278,8 +278,9 @@ Mempool.prototype.addBlock = function addBlock(block, callback, force) {
Mempool.prototype.removeBlock = function removeBlock(block, callback, force) {
var self = this;
var unlock = this._lock(removeBlock, [block, callback], force);
var entry;
var unlock, entry;
unlock = this._lock(removeBlock, [block, callback], force);
if (!unlock)
return;
@ -620,9 +621,10 @@ Mempool.prototype.addTX = function addTX(tx, callback, force) {
var lockFlags = constants.flags.STANDARD_LOCKTIME_FLAGS;
var hash = tx.hash('hex');
var ret = {};
var entry;
var unlock, entry;
unlock = this._lock(addTX, [tx, callback], force);
var unlock = this._lock(addTX, [tx, callback], force);
if (!unlock)
return;
@ -771,9 +773,10 @@ Mempool.prototype.addTX = function addTX(tx, callback, force) {
Mempool.prototype.addUnchecked = function addUnchecked(entry, callback, force) {
var self = this;
var resolved;
var unlock, resolved;
unlock = this._lock(addUnchecked, [entry, callback], force);
var unlock = this._lock(addUnchecked, [entry, callback], force);
if (!unlock)
return;
@ -829,9 +832,10 @@ Mempool.prototype.addUnchecked = function addUnchecked(entry, callback, force) {
Mempool.prototype.removeUnchecked = function removeUnchecked(entry, limit, callback, force) {
var self = this;
var rate;
var unlock, rate;
unlock = this._lock(removeUnchecked, [entry, limit, callback], force);
var unlock = this._lock(removeUnchecked, [entry, limit, callback], force);
if (!unlock)
return;