Skip to content

Commit

Permalink
restore alternate chain functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
vinarmani committed Oct 28, 2021
1 parent e57b196 commit 1baf12f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,9 @@ class Chain extends AsyncEmitter {
if (entry.chainwork.lte(this.tip.chainwork)) {
// Save block to an alternate chain.
await this.saveAlternate(entry, block, prev, flags);
// Quick fix to stop syncing to eCash (comment out line bove this comment)
// this.logger.debug('Block chainwork lower than tip: %h.', block.hash());
// throw new VerifyError(block, 'invalid', 'not-longest-chain', 100);
} else {
// Attempt to add block to the chain index.
await this.setBestChain(entry, block, prev, flags);
Expand Down
2 changes: 2 additions & 0 deletions lib/net/peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,7 @@ class Peer extends EventEmitter {
*/

getBlock(hashes) {
console.log('in peer.getBlock');
this.getItems(this.blockType(), hashes);
}

Expand Down Expand Up @@ -1811,6 +1812,7 @@ class Peer extends EventEmitter {
*/

reject(msg, err) {
console.log('reject err', err);
this.sendReject(err.code, err.reason, msg, err.hash);
return this.increaseBan(err.score);
}
Expand Down

0 comments on commit 1baf12f

Please sign in to comment.