aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-09-13 10:22:13 +0200
committerRiccardo Spagni <ric@spagni.net>2014-09-13 10:24:39 +0200
commit9c56b38b16059f654280ee59614b645fbdfa0e7e (patch)
tree8ce892e47b9e80cf72411c5bad4f343d299c5e14 /src/cryptonote_core
parent63f60b17779ef9f2ff8939bf69eab4173d81191f (diff)
parentbb2b606e91df625aeb03e311f44827b9250ea667 (diff)
downloadmonzero-core-9c56b38b16059f654280ee59614b645fbdfa0e7e.tar.gz
monzero-core-9c56b38b16059f654280ee59614b645fbdfa0e7e.tar.xz
monzero-core-9c56b38b16059f654280ee59614b645fbdfa0e7e.zip
Merge pull request #136
bb2b606 fix incorrect error message (obvious cut and paste bug from upstream) (iamsmooth) 6b77e83 Change wallet to not try to extract tx public key when tx has no outputs (fixes 202612 tx format messages and is otherwise correct) (iamsmooth) 08205f0 output rng fix from boolberry (iamsmooth)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain_storage.cpp3
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp
index c5f12d76f..c80cec92c 100644
--- a/src/cryptonote_core/blockchain_storage.cpp
+++ b/src/cryptonote_core/blockchain_storage.cpp
@@ -1006,7 +1006,6 @@ size_t blockchain_storage::find_end_of_allowed_index(const std::vector<std::pair
//------------------------------------------------------------------
bool blockchain_storage::get_random_outs_for_amounts(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res)
{
- srand(static_cast<unsigned int>(time(NULL)));
CRITICAL_REGION_LOCAL(m_blockchain_lock);
BOOST_FOREACH(uint64_t amount, req.amounts)
{
@@ -1029,7 +1028,7 @@ bool blockchain_storage::get_random_outs_for_amounts(const COMMAND_RPC_GET_RANDO
size_t try_count = 0;
for(uint64_t j = 0; j != req.outs_count && try_count < up_index_limit;)
{
- size_t i = rand()%up_index_limit;
+ size_t i = crypto::rand<size_t>()%up_index_limit;
if(used.count(i))
continue;
bool added = add_out_to_get_random_outs(amount_outs, result_outs, amount, i);
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 9643824bc..637b8fea6 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -257,7 +257,7 @@ namespace cryptonote
//check if tx use different key images
if(!check_tx_inputs_keyimages_diff(tx))
{
- LOG_PRINT_RED_L1("tx is too large " << get_object_blobsize(tx) << ", expected not bigger than " << m_blockchain_storage.get_current_comulative_blocksize_limit() - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE);
+ LOG_PRINT_RED_L1("tx uses a single key image more than once");
return false;
}