diff options
author | luigi1111 <luigi1111w@gmail.com> | 2023-02-06 12:24:17 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2023-02-06 12:24:17 -0500 |
commit | 672eedf9c29ef6f721ed736690585b5bf9cfd056 (patch) | |
tree | 1de0d55de5ea0e2c0dbf3df399c1bfc9ff00fc7a /src/rpc | |
parent | Merge pull request #8675 (diff) | |
parent | rpc: do not misidentify coinbase txes as pruned (diff) | |
download | monero-672eedf9c29ef6f721ed736690585b5bf9cfd056.tar.xz |
Merge pull request #8691
934b798 rpc: do not misidentify coinbase txes as pruned (moneromooo-monero)
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 12 |
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)); |