diff --git a/src/MicroCore.cpp b/src/MicroCore.cpp index be2a723..2c38204 100644 --- a/src/MicroCore.cpp +++ b/src/MicroCore.cpp @@ -143,7 +143,17 @@ MicroCore::get_tx(const crypto::hash& tx_hash, transaction& tx) } catch (TX_DNE const& e) { - cerr << "MicroCore::get_tx: " << e.what() << endl; + try + { + // coinbase txs are not considered pruned + tx = m_blockchain_storage.get_db().get_pruned_tx(tx_hash); + return true; + } + catch (TX_DNE const& e) + { + cerr << "MicroCore::get_tx: " << e.what() << endl; + } + return false; } } diff --git a/src/page.h b/src/page.h index c74c8cb..4fc4521 100644 --- a/src/page.h +++ b/src/page.h @@ -4506,11 +4506,6 @@ json_transaction(string tx_hash_str) no_confirmations = txd.no_confirmations; } - // get tx from tx fetched. can be use to double check - // if what we return in the json response agrees with - // what tx_hash was requested - string tx_hash_str_again = pod_to_hex(get_transaction_hash(tx)); - // get basic tx info j_data = get_tx_json(tx, txd); @@ -6490,7 +6485,15 @@ get_tx_details(const transaction& tx, tx_details txd; // get tx hash - txd.hash = get_transaction_hash(tx); + + if (!tx.pruned) + { + txd.hash = get_transaction_hash(tx); + } + else + { + txd.hash = get_pruned_transaction_hash(tx, tx.prunable_hash); + } // get tx public key from extra // this check if there are two public keys