save memory by not storing prevBlock.

This commit is contained in:
Christopher Jeffrey 2016-01-20 13:58:11 -08:00
parent ef44bf44f0
commit e461e44303

View File

@ -61,7 +61,7 @@ function Chain(options) {
{
hash: network.genesis.hash,
version: network.genesis.version,
prevBlock: network.genesis.prevBlock,
// prevBlock: network.genesis.prevBlock,
ts: network.genesis.ts,
bits: network.genesis.bits,
height: 0
@ -349,7 +349,7 @@ Chain.prototype.add = function add(block, peer) {
entry = new ChainBlock(this, {
hash: hash,
version: block.version,
prevBlock: prevHash,
// prevBlock: prevHash,
ts: block.ts,
bits: block.bits,
height: prevHeight + 1
@ -872,7 +872,7 @@ function ChainBlock(chain, data) {
this.chain = chain;
this.hash = data.hash;
this.version = data.version;
this.prevBlock = data.prevBlock;
// this.prevBlock = data.prevBlock;
this.ts = data.ts;
this.bits = data.bits;
this.height = data.height;
@ -950,7 +950,7 @@ ChainBlock.prototype.toJSON = function() {
return {
hash: this.hash,
version: this.version,
prevBlock: this.prevBlock,
// prevBlock: this.prevBlock,
ts: this.ts,
bits: this.bits,
height: this.height