fix verifyContext.
This commit is contained in:
parent
fe46d1ada5
commit
02e4c9e266
@ -670,7 +670,7 @@ Chain.prototype.add = function add(block, peer, callback) {
|
||||
var self = this;
|
||||
var initial = block;
|
||||
var code = Chain.codes.unchanged;
|
||||
var hash, prevHash, prevHeight, entry, tip, existing, checkpoint;
|
||||
var hash, prevHash, prevHeight, entry, tip, existing, checkpoint, prev;
|
||||
var total = 0;
|
||||
|
||||
callback = utils.asyncify(callback);
|
||||
@ -815,11 +815,14 @@ Chain.prototype.add = function add(block, peer, callback) {
|
||||
}
|
||||
}
|
||||
|
||||
// self._verifyContext(block, prev, function(err, verified) {
|
||||
// Lookup previous entry.
|
||||
prev = self.db.get(prevHeight);
|
||||
assert(prev);
|
||||
|
||||
// Do "contextual" verification on our block
|
||||
// now that we're certain its previous
|
||||
// block is in the chain.
|
||||
// self._verifyContext(block, prev, function(err, verified) {
|
||||
if (!block.verifyContext(prev)) {
|
||||
code = Chain.codes.invalid;
|
||||
self.emit('invalid', {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user