various small changes to bitcore
This commit is contained in:
parent
0bdcfa3045
commit
b3f36c3e72
2
Block.js
2
Block.js
@ -64,7 +64,7 @@ function spec(b) {
|
|||||||
|
|
||||||
var txCount = parser.varInt();
|
var txCount = parser.varInt();
|
||||||
|
|
||||||
for (i = 0; i < txCount; i++) {
|
for (var i = 0; i < txCount; i++) {
|
||||||
var tx = new Transaction();
|
var tx = new Transaction();
|
||||||
tx.parse(parser);
|
tx.parse(parser);
|
||||||
this.txs.push(tx);
|
this.txs.push(tx);
|
||||||
|
|||||||
@ -476,7 +476,7 @@ function spec(b) {
|
|||||||
lock_time: tx.lock_time,
|
lock_time: tx.lock_time,
|
||||||
ins: tx.ins,
|
ins: tx.ins,
|
||||||
outs: tx.outs,
|
outs: tx.outs,
|
||||||
tx: tx,
|
tx: tx,
|
||||||
};
|
};
|
||||||
|
|
||||||
case 'getblocks':
|
case 'getblocks':
|
||||||
|
|||||||
@ -553,7 +553,7 @@ function spec(b) {
|
|||||||
var ins = this.ins.map(function (txin) {
|
var ins = this.ins.map(function (txin) {
|
||||||
var txinObj = {
|
var txinObj = {
|
||||||
prev_out: {
|
prev_out: {
|
||||||
hash: new Buffer(txin.getOutpointHash()).reverse().toString(hex),
|
hash: new Buffer(txin.getOutpointHash()).reverse().toString('hex'),
|
||||||
n: txin.getOutpointIndex()
|
n: txin.getOutpointIndex()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
13
const.js
13
const.js
@ -1,7 +1,18 @@
|
|||||||
|
|
||||||
exports.MSG = {
|
MSG = {
|
||||||
TX: 1,
|
TX: 1,
|
||||||
BLOCK: 2,
|
BLOCK: 2,
|
||||||
FILTERED_BLOCK: 3,
|
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
Block a user