check IsMine for tx conversions.
This commit is contained in:
parent
d8701332c0
commit
d50c103c00
@ -5699,6 +5699,16 @@ ctx_to_jstx(const CTransaction& ctx, uint256& block_hash, Local<Object> jstx) {
|
||||
jstx->Set(NanNew<String>("timereceived"),
|
||||
NanNew<Number>((uint32_t)mapBlockIndex[block_hash]->GetBlockTime())->ToUint32());
|
||||
#if 0
|
||||
bool is_mine = false;
|
||||
for (unsigned int vo = 0; vo < ctx.vout.size(); vo++) {
|
||||
const CTxOut& txout = ctx.vout[vo];
|
||||
const CScript& scriptPubKey = txout.scriptPubKey;
|
||||
if (IsMine(*pwalletMain, scriptPubKey)) {
|
||||
is_mine = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (is_mine) {
|
||||
jstx->Set(NanNew<String>("blockhash"), NanNew<String>(block_hash.GetHex()));
|
||||
CWalletTx cwtx(pwalletMain, ctx);
|
||||
int confirms = cwtx.GetDepthInMainChain();
|
||||
@ -5723,6 +5733,7 @@ ctx_to_jstx(const CTransaction& ctx, uint256& block_hash, Local<Object> jstx) {
|
||||
jstx->Set(NanNew<String>("walletconflicts"), conflicts);
|
||||
jstx->Set(NanNew<String>("time"), NanNew<Number>(cwtx.GetTxTime()));
|
||||
jstx->Set(NanNew<String>("timereceived"), NanNew<Number>((int64_t)cwtx.nTimeReceived));
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
jstx->Set(NanNew<String>("blockhash"), NanNew<String>(uint256(0).GetHex()));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user