drop relayedBy.

This commit is contained in:
Christopher Jeffrey 2016-02-24 17:47:21 -08:00
parent 15a3f4b28b
commit 41c84c1937
5 changed files with 0 additions and 21 deletions

View File

@ -34,8 +34,6 @@ function AbstractBlock(data) {
this._raw = data._raw || null;
this._size = data._size || 0;
this.relayedBy = data.relayedBy || '0.0.0.0';
this._chain = data.chain;
this.valid = null;

View File

@ -225,7 +225,6 @@ Block.prototype.toJSON = function toJSON() {
return {
type: this.type,
height: this.height,
relayedBy: this.relayedBy,
hash: utils.revHex(this.hash('hex')),
version: this.version,
prevBlock: utils.revHex(this.prevBlock),
@ -260,7 +259,6 @@ Block.prototype.toCompact = function toCompact() {
prevBlock: this.prevBlock,
ts: this.ts,
height: this.height,
relayedBy: this.relayedBy,
block: utils.toHex(this.render())
};
};
@ -277,7 +275,6 @@ Block._fromCompact = function _fromCompact(json) {
data = parser.parseBlock(raw);
data.height = json.height;
data.relayedBy = json.relayedBy;
return data;
};

View File

@ -38,19 +38,16 @@ function MTX(options) {
this._offset = 0;
this.height = -1;
this.relayedBy = '0.0.0.0';
this._chain = options.chain;
if (options.inputs) {
assert(this.inputs.length === 0);
options.inputs.forEach(function(input) {
this.addInput(input);
}, this);
}
if (options.outputs) {
assert(this.outputs.length === 0);
options.outputs.forEach(function(output) {
this.addOutput(output);
}, this);
@ -1047,7 +1044,6 @@ MTX.prototype.toCompact = function toCompact(coins) {
height: this.height,
ts: this.ts,
ps: this.ps,
relayedBy: this.relayedBy,
changeIndex: this.changeIndex,
coins: coins ? this.inputs.map(function(input) {
return input.output ? input.output.toRaw('hex') : null;
@ -1068,7 +1064,6 @@ MTX._fromCompact = function _fromCompact(json) {
data.block = json.block;
data.ts = json.ts;
data.ps = json.ps;
data.relayedBy = json.relayedBy;
data.changeIndex = json.changeIndex;
if (json.coins) {
@ -1095,7 +1090,6 @@ MTX.prototype.toJSON = function toJSON() {
block: this.block ? utils.revHex(this.block) : null,
ts: this.ts,
ps: this.ps,
relayedBy: this.relayedBy,
changeIndex: this.changeIndex,
version: this.version,
inputs: this.inputs.map(function(input) {
@ -1114,7 +1108,6 @@ MTX._fromJSON = function fromJSON(json) {
height: json.height,
ts: json.ts,
ps: json.ps,
relayedBy: json.relayedBy,
changeIndex: json.changeIndex,
version: json.version,
inputs: json.inputs.map(function(input) {

View File

@ -415,15 +415,12 @@ Peer.prototype._onPacket = function onPacket(packet) {
return this._handleReject(payload);
if (cmd === 'block') {
payload.relayedBy = this.host || '0.0.0.0';
payload = bcoin.block(payload);
} else if (cmd === 'merkleblock') {
payload.relayedBy = this.host || '0.0.0.0';
payload = bcoin.merkleblock(payload);
this.lastBlock = payload;
return;
} else if (cmd === 'tx') {
payload.relayedBy = this.host || '0.0.0.0';
payload = bcoin.tx(payload, this.lastBlock);
if (this.lastBlock) {
if (payload.block) {

View File

@ -36,7 +36,6 @@ function TX(data, block) {
this._offset = data._offset || 0;
this.height = data.height != null ? data.height : -1;
this.relayedBy = data.relayedBy || '0.0.0.0';
this._chain = data.chain;
@ -68,7 +67,6 @@ function TX(data, block) {
}
TX.prototype.setBlock = function setBlock(block) {
this.relayedBy = block.relayedBy;
this.ts = block.ts;
this.block = block.hash('hex');
this.height = block.height;
@ -763,7 +761,6 @@ TX.prototype.toCompact = function toCompact(coins) {
block: this.block,
height: this.height,
ts: this.ts,
relayedBy: this.relayedBy,
coins: coins ? this.inputs.map(function(input) {
return input.output ? input.output.toRaw('hex') : null;
}) : null,
@ -782,7 +779,6 @@ TX._fromCompact = function _fromCompact(json) {
data.height = json.height;
data.block = json.block;
data.ts = json.ts;
data.relayedBy = json.relayedBy;
if (json.coins) {
json.coins.forEach(function(output, i) {
@ -807,7 +803,6 @@ TX.prototype.toJSON = function toJSON() {
height: this.height,
block: this.block ? utils.revHex(this.block) : null,
ts: this.ts,
relayedBy: this.relayedBy,
version: this.version,
inputs: this.inputs.map(function(input) {
return input.toJSON();
@ -824,7 +819,6 @@ TX._fromJSON = function fromJSON(json) {
block: json.block ? utils.revHex(json.block) : null,
height: json.height,
ts: json.ts,
relayedBy: json.relayedBy,
version: json.version,
inputs: json.inputs.map(function(input) {
return bcoin.input._fromJSON(input);