|
|
|
@ -47,50 +47,36 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
@@ -47,50 +47,36 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
|
|
|
|
|
//
|
|
|
|
|
// Credit
|
|
|
|
|
//
|
|
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
|
{ |
|
|
|
|
if(wallet->IsMine(txout)) |
|
|
|
|
{ |
|
|
|
|
TransactionRecord sub(hash, nTime); |
|
|
|
|
|
|
|
|
|
sub.credit = nNet; |
|
|
|
|
|
|
|
|
|
CBitcoinAddress address; |
|
|
|
|
sub.idx = parts.size(); // sequence number
|
|
|
|
|
sub.credit = txout.nValue; |
|
|
|
|
if (wtx.IsCoinBase()) |
|
|
|
|
{ |
|
|
|
|
// Generated
|
|
|
|
|
sub.type = TransactionRecord::Generated; |
|
|
|
|
|
|
|
|
|
if (nCredit == 0) |
|
|
|
|
{ |
|
|
|
|
int64 nUnmatured = 0; |
|
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
|
nUnmatured += wallet->GetCredit(txout); |
|
|
|
|
sub.credit = nUnmatured; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
else if (ExtractAddress(txout.scriptPubKey, address) && wallet->HaveKey(address)) |
|
|
|
|
{ |
|
|
|
|
bool foundAddress = false; |
|
|
|
|
// Received by Bitcoin Address
|
|
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
|
{ |
|
|
|
|
if(wallet->IsMine(txout)) |
|
|
|
|
{ |
|
|
|
|
CBitcoinAddress address; |
|
|
|
|
if (ExtractAddress(txout.scriptPubKey, address) && wallet->HaveKey(address)) |
|
|
|
|
{ |
|
|
|
|
sub.type = TransactionRecord::RecvWithAddress; |
|
|
|
|
sub.address = address.ToString(); |
|
|
|
|
foundAddress = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(!foundAddress) |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Received by IP connection, or other non-address transaction like OP_EVAL
|
|
|
|
|
// Received by IP connection (deprecated features), or a multisignature or other non-simple transaction
|
|
|
|
|
sub.type = TransactionRecord::RecvFromOther; |
|
|
|
|
sub.address = mapValue["from"]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
parts.append(sub); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
bool fAllFromMe = true; |
|
|
|
|