read hashes as hex.

This commit is contained in:
Christopher Jeffrey 2016-04-04 15:26:00 -07:00
parent 9e61d0ee86
commit e22d0c56b0

View File

@ -128,7 +128,7 @@ Parser.parseSubmitOrder = function parseSubmitOrder(p) {
p = new BufferReader(p);
p.start();
return {
hash: p.readHash(),
hash: p.readHash('hex'),
tx: Parser.parseTX(p),
_size: p.end()
};
@ -143,7 +143,7 @@ Parser.parseReply = function parseReply(p) {
p = new BufferReader(p);
p.start();
return {
hash: p.readHash(),
hash: p.readHash('hex'),
code: p.readU32(),
publicKey: p.readVarBytes(),
_size: p.end()
@ -458,7 +458,7 @@ Parser.parseInv = function parseInv(p) {
for (i = 0; i < count; i++) {
items.push({
type: p.readU32(),
hash: p.readHash()
hash: p.readHash('hex')
});
}
@ -475,8 +475,8 @@ Parser.parseMerkleBlock = function parseMerkleBlock(p) {
p.start();
version = p.readU32();
prevBlock = p.readHash();
merkleRoot = p.readHash();
prevBlock = p.readHash('hex');
merkleRoot = p.readHash('hex');
ts = p.readU32();
bits = p.readU32();
nonce = p.readU32();
@ -487,7 +487,7 @@ Parser.parseMerkleBlock = function parseMerkleBlock(p) {
hashes = new Array(hashCount);
for (i = 0; i < hashCount; i++)
hashes[i] = p.readHash();
hashes[i] = p.readHash('hex');
flags = p.readVarBytes();
@ -517,8 +517,8 @@ Parser.parseHeaders = function parseHeaders(p) {
for (i = 0; i < count; i++) {
headers.push({
version: p.readU32(), // Technically signed
prevBlock: p.readHash(),
merkleRoot: p.readHash(),
prevBlock: p.readHash('hex'),
merkleRoot: p.readHash('hex'),
ts: p.readU32(),
bits: p.readU32(),
nonce: p.readU32(),
@ -557,8 +557,8 @@ Parser.parseBlock = function parseBlock(p) {
p.start();
version = p.readU32(); // Technically signed
prevBlock = p.readHash();
merkleRoot = p.readHash();
prevBlock = p.readHash('hex');
merkleRoot = p.readHash('hex');
ts = p.readU32();
bits = p.readU32();
nonce = p.readU32();
@ -592,8 +592,8 @@ Parser.parseBlockCompact = function parseBlockCompact(p) {
p.start();
version = p.readU32(); // Technically signed
prevBlock = p.readHash();
merkleRoot = p.readHash();
prevBlock = p.readHash('hex');
merkleRoot = p.readHash('hex');
ts = p.readU32();
bits = p.readU32();
nonce = p.readU32();
@ -644,7 +644,7 @@ Parser.parseInput = function parseInput(p) {
p = new BufferReader(p);
p.start();
hash = p.readHash();
hash = p.readHash('hex');
index = p.readU32();
script = Parser.parseScript(p);
sequence = p.readU32();
@ -713,7 +713,7 @@ Parser.parseCoin = function parseCoin(p, extended) {
coinbase = p.readU8() === 1;
if (extended) {
hash = p.readHash();
hash = p.readHash('hex');
index = p.readU32();
}
@ -889,7 +889,7 @@ Parser.parseReject = function parseReject(p) {
reason = p.readVarString('ascii');
if (p.left() >= 32)
data = p.readHash();
data = p.readHash('hex');
else
data = null;