From 61ee01f555e4a9f236317c722c238320578574d4 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 23 Oct 2014 15:42:00 -0700 Subject: [PATCH] comment. misc. --- src/bitcoindjs.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 5aeeea32..355e8466 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -2780,6 +2780,8 @@ async_import_key_after(uv_work_t *req) { * CTransactions), and vice versa. */ +// XXX Potentially add entire function's code. If there's a race +// condition, the duplicate check will handle it. CBlockIndex * find_new_block_index(uint256 hash, uint256 hashPrevBlock, bool *is_allocated) { // Check for duplicate @@ -2823,12 +2825,12 @@ cblock_to_jsblock(const CBlock& cblock, CBlockIndex* cblock_index, Local // // Headers // - jsblock->Set(NanNew("version"), NanNew(cblock.nVersion)); - jsblock->Set(NanNew("previousblockhash"), NanNew(cblock.hashPrevBlock.ToString())); - jsblock->Set(NanNew("merkleroot"), NanNew(cblock.hashMerkleRoot.GetHex())); - jsblock->Set(NanNew("time"), NanNew((unsigned int)cblock.GetBlockTime())->ToUint32()); - jsblock->Set(NanNew("bits"), NanNew((unsigned int)cblock.nBits)->ToUint32()); - jsblock->Set(NanNew("nonce"), NanNew((unsigned int)cblock.nNonce)->ToUint32()); + jsblock->Set(NanNew("version"), NanNew((int32_t)cblock.nVersion)); + jsblock->Set(NanNew("previousblockhash"), NanNew((std::string)cblock.hashPrevBlock.ToString())); + jsblock->Set(NanNew("merkleroot"), NanNew((std::string)cblock.hashMerkleRoot.GetHex())); + jsblock->Set(NanNew("time"), NanNew((uint32_t)cblock.GetBlockTime())->ToUint32()); + jsblock->Set(NanNew("bits"), NanNew((uint32_t)cblock.nBits)->ToUint32()); + jsblock->Set(NanNew("nonce"), NanNew((uint32_t)cblock.nNonce)->ToUint32()); if (cblock_index) { jsblock->Set(NanNew("difficulty"), NanNew(GetDifficulty(cblock_index)));