From 9e4c26ccd274b54e49aa844140e8487484bc6763 Mon Sep 17 00:00:00 2001 From: Duke Date: Tue, 5 Dec 2023 22:51:59 -0500 Subject: [PATCH] Show transaction list in CSV format when viewing a block; allow viewing block 0 --- src/mainwindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9d5e1cc..18bb54d 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -912,7 +912,7 @@ void MainWindow::getBlock() { // First thing is ask the user for a block height bool ok; int i = QInputDialog::getInt(this, tr("Get Block Info"), - tr("Enter Block Height:"), 1, 1, 2147483647, 1, &ok); + tr("Enter Block Height:"), 12345, 0, 2147483647, 1, &ok); if (!ok) return; @@ -943,7 +943,11 @@ void MainWindow::getBlock() { property_value = props.toObject()[property_name].toBool() ? "true" : "false" ; } else if (props.toObject()[property_name].isArray()) { DEBUG( property_name << " is an array"); - //property_value = QString( props.toObject()[property_name][0] ); // TODO: this is only the first tx + auto txs = props.toObject()[property_name].toArray(); + for (const auto& tx : txs) { + property_value += tx.toString() + " , "; + } + // property_value = QJsonDocument(txs).toJson(); } else if (props.toObject()[property_name].isObject()) { DEBUG( property_name << " is an object"); }