@@ -641,16 +641,16 @@ Value getbalance(const Array& params, bool fHelp)
641
641
642
642
int64_t allFee;
643
643
string strSentAccount;
644
- list<pair<CTxDestination, int64_t > > listReceived;
645
- list<pair<CTxDestination, int64_t > > listSent;
644
+ list<COutputEntry > listReceived;
645
+ list<COutputEntry > listSent;
646
646
wtx.GetAmounts (listReceived, listSent, allFee, strSentAccount, filter);
647
647
if (wtx.GetDepthInMainChain () >= nMinDepth)
648
648
{
649
- BOOST_FOREACH (const PAIRTYPE (CTxDestination, int64_t ) & r, listReceived)
650
- nBalance += r.second ;
649
+ BOOST_FOREACH (const COutputEntry & r, listReceived)
650
+ nBalance += r.amount ;
651
651
}
652
- BOOST_FOREACH (const PAIRTYPE (CTxDestination, int64_t )& r , listSent)
653
- nBalance -= r. second ;
652
+ BOOST_FOREACH (const COutputEntry& s , listSent)
653
+ nBalance -= s. amount ;
654
654
nBalance -= allFee;
655
655
}
656
656
return ValueFromAmount (nBalance);
@@ -1133,8 +1133,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
1133
1133
{
1134
1134
int64_t nFee;
1135
1135
string strSentAccount;
1136
- list<pair<CTxDestination, int64_t > > listReceived;
1137
- list<pair<CTxDestination, int64_t > > listSent;
1136
+ list<COutputEntry > listReceived;
1137
+ list<COutputEntry > listSent;
1138
1138
1139
1139
wtx.GetAmounts (listReceived, listSent, nFee, strSentAccount, filter);
1140
1140
@@ -1144,15 +1144,16 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
1144
1144
// Sent
1145
1145
if ((!listSent.empty () || nFee != 0 ) && (fAllAccounts || strAccount == strSentAccount))
1146
1146
{
1147
- BOOST_FOREACH (const PAIRTYPE (CTxDestination, int64_t ) & s, listSent)
1147
+ BOOST_FOREACH (const COutputEntry & s, listSent)
1148
1148
{
1149
1149
Object entry;
1150
- if (involvesWatchonly || (::IsMine (*pwalletMain, s.first ) & ISMINE_WATCH_ONLY))
1150
+ if (involvesWatchonly || (::IsMine (*pwalletMain, s.destination ) & ISMINE_WATCH_ONLY))
1151
1151
entry.push_back (Pair (" involvesWatchonly" , true ));
1152
1152
entry.push_back (Pair (" account" , strSentAccount));
1153
- MaybePushAddress (entry, s.first );
1153
+ MaybePushAddress (entry, s.destination );
1154
1154
entry.push_back (Pair (" category" , " send" ));
1155
- entry.push_back (Pair (" amount" , ValueFromAmount (-s.second )));
1155
+ entry.push_back (Pair (" amount" , ValueFromAmount (-s.amount )));
1156
+ entry.push_back (Pair (" vout" , s.vout ));
1156
1157
entry.push_back (Pair (" fee" , ValueFromAmount (-nFee)));
1157
1158
if (fLong )
1158
1159
WalletTxToJSON (wtx, entry);
@@ -1163,18 +1164,18 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
1163
1164
// Received
1164
1165
if (listReceived.size () > 0 && wtx.GetDepthInMainChain () >= nMinDepth)
1165
1166
{
1166
- BOOST_FOREACH (const PAIRTYPE (CTxDestination, int64_t ) & r, listReceived)
1167
+ BOOST_FOREACH (const COutputEntry & r, listReceived)
1167
1168
{
1168
1169
string account;
1169
- if (pwalletMain->mapAddressBook .count (r.first ))
1170
- account = pwalletMain->mapAddressBook [r.first ].name ;
1170
+ if (pwalletMain->mapAddressBook .count (r.destination ))
1171
+ account = pwalletMain->mapAddressBook [r.destination ].name ;
1171
1172
if (fAllAccounts || (account == strAccount))
1172
1173
{
1173
1174
Object entry;
1174
- if (involvesWatchonly || (::IsMine (*pwalletMain, r.first ) & ISMINE_WATCH_ONLY))
1175
+ if (involvesWatchonly || (::IsMine (*pwalletMain, r.destination ) & ISMINE_WATCH_ONLY))
1175
1176
entry.push_back (Pair (" involvesWatchonly" , true ));
1176
1177
entry.push_back (Pair (" account" , account));
1177
- MaybePushAddress (entry, r.first );
1178
+ MaybePushAddress (entry, r.destination );
1178
1179
if (wtx.IsCoinBase ())
1179
1180
{
1180
1181
if (wtx.GetDepthInMainChain () < 1 )
@@ -1188,7 +1189,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
1188
1189
{
1189
1190
entry.push_back (Pair (" category" , " receive" ));
1190
1191
}
1191
- entry.push_back (Pair (" amount" , ValueFromAmount (r.second )));
1192
+ entry.push_back (Pair (" amount" , ValueFromAmount (r.amount )));
1193
+ entry.push_back (Pair (" vout" , r.vout ));
1192
1194
if (fLong )
1193
1195
WalletTxToJSON (wtx, entry);
1194
1196
ret.push_back (entry);
@@ -1240,6 +1242,7 @@ Value listtransactions(const Array& params, bool fHelp)
1240
1242
" \" amount\" : x.xxx, (numeric) The amount in btc. This is negative for the 'send' category, and for the\n "
1241
1243
" 'move' category for moves outbound. It is positive for the 'receive' category,\n "
1242
1244
" and for the 'move' category for inbound funds.\n "
1245
+ " \" vout\" : n, (numeric) the vout value\n "
1243
1246
" \" fee\" : x.xxx, (numeric) The amount of the fee in btc. This is negative and only available for the \n "
1244
1247
" 'send' category of transactions.\n "
1245
1248
" \" confirmations\" : n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n "
@@ -1375,22 +1378,22 @@ Value listaccounts(const Array& params, bool fHelp)
1375
1378
const CWalletTx& wtx = (*it).second ;
1376
1379
int64_t nFee;
1377
1380
string strSentAccount;
1378
- list<pair<CTxDestination, int64_t > > listReceived;
1379
- list<pair<CTxDestination, int64_t > > listSent;
1381
+ list<COutputEntry > listReceived;
1382
+ list<COutputEntry > listSent;
1380
1383
int nDepth = wtx.GetDepthInMainChain ();
1381
1384
if (wtx.GetBlocksToMaturity () > 0 || nDepth < 0 )
1382
1385
continue ;
1383
1386
wtx.GetAmounts (listReceived, listSent, nFee, strSentAccount, includeWatchonly);
1384
1387
mapAccountBalances[strSentAccount] -= nFee;
1385
- BOOST_FOREACH (const PAIRTYPE (CTxDestination, int64_t ) & s, listSent)
1386
- mapAccountBalances[strSentAccount] -= s.second ;
1388
+ BOOST_FOREACH (const COutputEntry & s, listSent)
1389
+ mapAccountBalances[strSentAccount] -= s.amount ;
1387
1390
if (nDepth >= nMinDepth)
1388
1391
{
1389
- BOOST_FOREACH (const PAIRTYPE (CTxDestination, int64_t ) & r, listReceived)
1390
- if (pwalletMain->mapAddressBook .count (r.first ))
1391
- mapAccountBalances[pwalletMain->mapAddressBook [r.first ].name ] += r.second ;
1392
+ BOOST_FOREACH (const COutputEntry & r, listReceived)
1393
+ if (pwalletMain->mapAddressBook .count (r.destination ))
1394
+ mapAccountBalances[pwalletMain->mapAddressBook [r.destination ].name ] += r.amount ;
1392
1395
else
1393
- mapAccountBalances[" " ] += r.second ;
1396
+ mapAccountBalances[" " ] += r.amount ;
1394
1397
}
1395
1398
}
1396
1399
@@ -1424,6 +1427,7 @@ Value listsinceblock(const Array& params, bool fHelp)
1424
1427
" \" category\" :\" send|receive\" , (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n "
1425
1428
" \" amount\" : x.xxx, (numeric) The amount in btc. This is negative for the 'send' category, and for the 'move' category for moves \n "
1426
1429
" outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n "
1430
+ " \" vout\" : n, (numeric) the vout value\n "
1427
1431
" \" fee\" : x.xxx, (numeric) The amount of the fee in btc. This is negative and only available for the 'send' category of transactions.\n "
1428
1432
" \" confirmations\" : n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n "
1429
1433
" \" blockhash\" : \" hashvalue\" , (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n "
@@ -1528,6 +1532,7 @@ Value gettransaction(const Array& params, bool fHelp)
1528
1532
" \" address\" : \" bitcoinaddress\" , (string) The bitcoin address involved in the transaction\n "
1529
1533
" \" category\" : \" send|receive\" , (string) The category, either 'send' or 'receive'\n "
1530
1534
" \" amount\" : x.xxx (numeric) The amount in btc\n "
1535
+ " \" vout\" : n, (numeric) the vout value\n "
1531
1536
" }\n "
1532
1537
" ,...\n "
1533
1538
" ],\n "
0 commit comments