From 723c52bab9d75633b999b531789d5034cc67b6a3 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sat, 21 May 2016 14:38:01 +0800 Subject: [PATCH] fixes for the newest monero c++ api --- src/page.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/page.h b/src/page.h index 86c3551..79d8453 100644 --- a/src/page.h +++ b/src/page.h @@ -1078,8 +1078,19 @@ namespace xmreg { try { - out_amount_indices = core_storage->get_db() - .get_tx_amount_output_indices(txd.hash); + + uint64_t tx_index; + + if (core_storage->get_db().tx_exists(txd.hash, tx_index)) + { + out_amount_indices = core_storage->get_db() + .get_tx_amount_output_indices(tx_index); + } + else + { + cerr << "get_tx_outputs_gindexs failed to find transaction with id = " << txd.hash; + } + } catch(const exception& e) { @@ -1091,17 +1102,15 @@ namespace xmreg { try { - out_global_indices = core_storage->get_db() - .get_tx_output_indices(txd.hash); + core_storage->get_tx_outputs_gindexs(txd.hash, + out_global_indices); + } catch(const exception& e) { cerr << e.what() << endl; } - - - uint64_t output_idx {0}; mstch::array outputs;