fix(tx): list transactions with account "*" so labelled rows show
listtransactions was called with the default "" account, which returns only rows in the unnamed account. Transactions tied to a labelled address were left out of the History tab entirely. - All three listtransactions call sites now pass "*", which spans every account, so labelled-address rows appear alongside the rest. - With "*" the daemon also emits "move" accounting rows that have no txid, address or vout. Those are not wallet transactions, so they are skipped and never become blank History rows. No real transaction row is dropped by this filter. Tests cover that a "move" row is skipped while a labelled receive row is kept, and that the transparent collectors now page with "*". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -684,7 +684,7 @@ void RPCClient::z_getNewAddress(Callback cb, ErrorCallback err)
|
||||
|
||||
void RPCClient::listTransactions(int count, Callback cb, ErrorCallback err)
|
||||
{
|
||||
doRPC("listtransactions", {"", count}, cb, err);
|
||||
doRPC("listtransactions", {"*", count}, cb, err);
|
||||
}
|
||||
|
||||
void RPCClient::z_viewTransaction(const std::string& txid, Callback cb, ErrorCallback err)
|
||||
|
||||
@@ -932,6 +932,9 @@ void NetworkRefreshService::appendTransparentTransactions(std::vector<Transactio
|
||||
for (const auto& transactionJson : result) {
|
||||
TransactionInfo info;
|
||||
if (auto value = readOptional<std::string>(transactionJson, "txid")) info.txid = *value;
|
||||
// C266: listtransactions("*") also returns "move" accounting rows (no txid/address/vout) for
|
||||
// every account. They are not wallet transactions - skip so they never become blank History rows.
|
||||
if (info.txid.empty()) continue;
|
||||
if (auto value = readOptional<std::string>(transactionJson, "category")) info.type = *value;
|
||||
if (auto value = readOptional<double>(transactionJson, "amount")) info.amount = *value;
|
||||
if (auto value = readOptional<std::int64_t>(transactionJson, "time")) {
|
||||
@@ -1170,7 +1173,7 @@ NetworkRefreshService::TransactionRefreshResult NetworkRefreshService::collectTr
|
||||
// call (re-paging 1000 rows at a time formats ~rows^2/2000 rows); skip-paging stays the fallback.
|
||||
const int pageSize = transparentPageSize(snapshot.transparentRowHint);
|
||||
for (int skip = 0;; skip += pageSize) {
|
||||
json page = rpc.call("listtransactions", json::array({"", pageSize, skip}));
|
||||
json page = rpc.call("listtransactions", json::array({"*", pageSize, skip}));
|
||||
appendTransparentTransactions(result.transactions, knownTxids, page, snapshot.miningAddresses);
|
||||
const std::size_t got = page.is_array() ? page.size() : 0;
|
||||
result.transparentRowCount += got;
|
||||
@@ -1555,7 +1558,7 @@ NetworkRefreshService::TransactionRefreshResult NetworkRefreshService::collectRe
|
||||
try {
|
||||
std::set<std::string> recentTxids;
|
||||
std::vector<TransactionInfo> recentTransactions;
|
||||
json transactions = rpc.call("listtransactions", json::array({"", pageSize, 0}));
|
||||
json transactions = rpc.call("listtransactions", json::array({"*", pageSize, 0}));
|
||||
appendTransparentTransactions(recentTransactions, recentTxids, transactions, snapshot.miningAddresses);
|
||||
|
||||
// A coinbase changes category in place (immature -> generate at maturity, or -> orphan on a reorg): drop
|
||||
|
||||
Reference in New Issue
Block a user