improve ismine.
This commit is contained in:
parent
7e5c6a7dac
commit
614cb91dbf
|
@ -6013,15 +6013,15 @@ ctx_to_jstx(const CTransaction& ctx, uint256 blockhash, Local<Object> jstx) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CWalletTx cwtx(pwalletMain, ctx);
|
|
||||||
// XXX Determine wether this is our transaction
|
|
||||||
bool is_mine = cwtx.hashBlock != 0;
|
|
||||||
jstx->Set(NanNew<String>("ismine"), NanNew<Boolean>(is_mine));
|
|
||||||
|
|
||||||
// Find block hash if it's in our wallet
|
// Find block hash if it's in our wallet
|
||||||
if (blockhash == 0 && is_mine) {
|
bool is_mine = false;
|
||||||
blockhash = cwtx.hashBlock;
|
CWalletTx cwtx;
|
||||||
|
if (pwalletMain->mapWallet.count(ctx.GetHash())) {
|
||||||
|
cwtx = pwalletMain->mapWallet[ctx.GetHash()];
|
||||||
|
blockhash.SetHex(cwtx.hashBlock.GetHex());
|
||||||
|
is_mine = true;
|
||||||
}
|
}
|
||||||
|
jstx->Set(NanNew<String>("ismine"), NanNew<Boolean>(is_mine));
|
||||||
|
|
||||||
if (blockhash != 0) {
|
if (blockhash != 0) {
|
||||||
jstx->Set(NanNew<String>("blockhash"), NanNew<String>(blockhash.GetHex()));
|
jstx->Set(NanNew<String>("blockhash"), NanNew<String>(blockhash.GetHex()));
|
||||||
|
|
Loading…
Reference in New Issue