message: use messagePrefix naming over magicPrefix

This commit is contained in:
Daniel Cousens 2015-03-16 10:57:39 +11:00
parent 607b3b7983
commit 1079bf95c1

View file

@ -11,11 +11,11 @@ var ecurve = require('ecurve')
var ecparams = ecurve.getCurveByName('secp256k1')
function magicHash (message, network) {
var magicPrefix = new Buffer(network.magicPrefix)
var messagePrefix = new Buffer(network.messagePrefix)
var messageBuffer = new Buffer(message)
var lengthBuffer = bufferutils.varIntBuffer(messageBuffer.length)
var buffer = Buffer.concat([magicPrefix, lengthBuffer, messageBuffer])
var buffer = Buffer.concat([messagePrefix, lengthBuffer, messageBuffer])
return crypto.hash256(buffer)
}