aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2023-01-01 09:30:59 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2023-01-01 09:30:59 +0000
commit934b798c743ffea96751b920fd09103b9fcc12a8 (patch)
treec2b092ab32d2236b72170612cb5a5b3d7e26123f /src/rpc
parentMerge pull request #8635 (diff)
downloadmonero-934b798c743ffea96751b920fd09103b9fcc12a8.tar.xz
rpc: do not misidentify coinbase txes as pruned
Diffstat (limited to '')
-rw-r--r--src/rpc/core_rpc_server.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 16bcf2c04..c6d105fb4 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1009,7 +1009,17 @@ namespace cryptonote
CHECK_AND_ASSERT_MES(tx_hash == std::get<0>(tx), false, "mismatched tx hash");
e.tx_hash = *txhi++;
e.prunable_hash = epee::string_tools::pod_to_hex(std::get<2>(tx));
- if (req.split || req.prune || std::get<3>(tx).empty())
+
+ // coinbase txes do not have signatures to prune, so they appear to be pruned if looking just at prunable data being empty
+ bool pruned = std::get<3>(tx).empty();
+ if (pruned)
+ {
+ cryptonote::transaction t;
+ if (cryptonote::parse_and_validate_tx_base_from_blob(std::get<1>(tx), t) && is_coinbase(t))
+ pruned = false;
+ }
+
+ if (req.split || req.prune || pruned)
{
// use splitted form with pruned and prunable (filled only when prune=false and the daemon has it), leaving as_hex as empty
e.pruned_as_hex = string_tools::buff_to_hex_nodelimer(std::get<1>(tx));