From 95f140f373a4ffd8f78db5336a6a3efc72ff0037 Mon Sep 17 00:00:00 2001 From: Paul Shapiro Date: Tue, 28 Aug 2018 19:14:54 -0400 Subject: [PATCH] some cleanups per feedback --- src/monero_transfer_utils.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/monero_transfer_utils.cpp b/src/monero_transfer_utils.cpp index 0a427e0..8766820 100644 --- a/src/monero_transfer_utils.cpp +++ b/src/monero_transfer_utils.cpp @@ -380,11 +380,10 @@ void monero_transfer_utils::create_transaction( oe.first = mix_out__output.global_index; // crypto::public_key public_key = AUTO_VAL_INIT(public_key); - if(!string_tools::validate_hex(64, mix_out__output.public_key)) { + if(!string_tools::hex_to_pod(mix_out__output.public_key, public_key)) { retVals.errCode = givenAnInvalidPubKey; return; } - string_tools::hex_to_pod(mix_out__output.public_key, public_key); oe.second.dest = rct::pk2rct(public_key); // if (mix_out__output.rct != boost::none) { @@ -441,8 +440,6 @@ void monero_transfer_utils::create_transaction( string_tools::hex_to_pod(outputs[out_index].tx_pub_key, tx_pub_key); src.real_out_tx_key = tx_pub_key; // - add_tx_pub_key_to_extra(extra, tx_pub_key); // TODO: is this necessary? it doesn't seem to affect is_out_to_acc checks.. - // src.real_out_additional_tx_keys = get_additional_tx_pub_keys_from_extra(extra); // src.real_output = real_output_index; @@ -515,9 +512,8 @@ void monero_transfer_utils::create_transaction( retVals.errCode = needMoreMoneyThanFound; // TODO: return actual found_money and needed_money in generalized err params in return val return; } - cryptonote::transaction tx; - // TODO: need to initialize tx here? // + cryptonote::transaction tx; auto sources_copy = sources; crypto::secret_key tx_key; std::vector additional_tx_keys; @@ -660,7 +656,7 @@ void monero_transfer_utils::convenience__create_transaction( auto txBlob = t_serializable_object_to_blob(*actualCall_retVals.tx); size_t txBlob_byteLength = txBlob.size(); // cout << "txBlob: " << txBlob << endl; - cout << "txBlob_byteLength: " << txBlob_byteLength << endl; +// cout << "txBlob_byteLength: " << txBlob_byteLength << endl; THROW_WALLET_EXCEPTION_IF(txBlob_byteLength <= 0, error::wallet_internal_error, "Expected tx blob byte length > 0"); // // tx hash