Merge pull request #14 from maraoz/misc
various small changes to bitcore
This commit is contained in:
commit
2513a08eb9
2
Block.js
2
Block.js
|
@ -64,7 +64,7 @@ function spec(b) {
|
|||
|
||||
var txCount = parser.varInt();
|
||||
|
||||
for (i = 0; i < txCount; i++) {
|
||||
for (var i = 0; i < txCount; i++) {
|
||||
var tx = new Transaction();
|
||||
tx.parse(parser);
|
||||
this.txs.push(tx);
|
||||
|
|
|
@ -476,7 +476,7 @@ function spec(b) {
|
|||
lock_time: tx.lock_time,
|
||||
ins: tx.ins,
|
||||
outs: tx.outs,
|
||||
tx: tx,
|
||||
tx: tx,
|
||||
};
|
||||
|
||||
case 'getblocks':
|
||||
|
|
|
@ -553,7 +553,7 @@ function spec(b) {
|
|||
var ins = this.ins.map(function (txin) {
|
||||
var txinObj = {
|
||||
prev_out: {
|
||||
hash: new Buffer(txin.getOutpointHash()).reverse().toString(hex),
|
||||
hash: new Buffer(txin.getOutpointHash()).reverse().toString('hex'),
|
||||
n: txin.getOutpointIndex()
|
||||
}
|
||||
};
|
||||
|
|
13
const.js
13
const.js
|
@ -1,7 +1,18 @@
|
|||
|
||||
exports.MSG = {
|
||||
MSG = {
|
||||
TX: 1,
|
||||
BLOCK: 2,
|
||||
FILTERED_BLOCK: 3,
|
||||
};
|
||||
|
||||
MSG.to_str = function(t) {
|
||||
switch(t) {
|
||||
case MSG.TX: return 'transaction';
|
||||
case MSG.BLOCK: return 'block';
|
||||
case MSG.FILTERED_BLOCK: return 'filtered block';
|
||||
default: return 'unknown';
|
||||
}
|
||||
}
|
||||
|
||||
exports.MSG = MSG;
|
||||
|
||||
|
|
Loading…
Reference in New Issue