more debugging.
This commit is contained in:
parent
2a0f777dbd
commit
0fd0b7c7b6
|
@ -145,6 +145,10 @@ Bitcoin.prototype.getBlock = function(hash, callback) {
|
|||
};
|
||||
|
||||
Bitcoin.prototype.getTx = function(hash, blockHash, callback) {
|
||||
if (hash[1] === 'x') hash = hash.slice(2);
|
||||
if (blockHash[1] === 'x') blockHash = blockHash.slice(2);
|
||||
// hash = utils.revHex(hash);
|
||||
// blockHash = utils.revHex(blockHash);
|
||||
return bitcoindjs.getTx(hash, blockHash, callback);
|
||||
};
|
||||
|
||||
|
@ -181,6 +185,20 @@ Bitcoin.prototype.close = function(callback) {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
|
||||
var utils = {};
|
||||
|
||||
utils.revHex = function revHex(s) {
|
||||
var r = '';
|
||||
for (var i = 0; i < s.length; i += 2) {
|
||||
r = s.slice(i, i + 2) + r;
|
||||
}
|
||||
return r;
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose
|
||||
*/
|
||||
|
@ -188,3 +206,4 @@ Bitcoin.prototype.close = function(callback) {
|
|||
module.exports = exports = Bitcoin;
|
||||
exports.Bitcoin = Bitcoin;
|
||||
exports.native = bitcoindjs;
|
||||
exports.utils = utils;
|
||||
|
|
|
@ -904,8 +904,8 @@ NAN_METHOD(GetTx) {
|
|||
blockHash = "0x" + blockHash;
|
||||
}
|
||||
|
||||
printf("tx: %s\n", txHash);
|
||||
printf("block: %s\n", blockHash);
|
||||
printf("tx: %s\n", txHash.c_str());
|
||||
printf("block: %s\n", blockHash.c_str());
|
||||
|
||||
uint256 hash(txHash);
|
||||
uint256 hashBlock(blockHash);
|
||||
|
|
Loading…
Reference in New Issue