diff --git a/lib/net/parser.js b/lib/net/parser.js index 1db15fb5..81501b99 100644 --- a/lib/net/parser.js +++ b/lib/net/parser.js @@ -131,14 +131,15 @@ Parser.prototype.parse = function parse(data) { return; } - checksum = crypto.checksum(data).readUInt32LE(0, true); + checksum = crypto.hash256(data).readUInt32LE(0, true); if (checksum !== this.header.checksum) { this.waiting = 24; this.header = null; return this.error( 'Invalid checksum: %d != %d', - checksum, this.header.checksum); + utils.hex32(checksum), + utils.hex32(this.header.checksum)); } try { @@ -167,7 +168,7 @@ Parser.prototype.parseHeader = function parseHeader(data) { magic = data.readUInt32LE(0, true); if (magic !== this.network.magic) - return this.error('Invalid magic value: %s.', magic.toString(16)); + return this.error('Invalid magic value: %s.', utils.hex32(magic)); // Count length of the cmd for (i = 0; data[i + 4] !== 0 && i < 12; i++);