aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-03-24 02:46:48 -0400
committerThomas Winget <tewinget@gmail.com>2015-03-24 02:47:15 -0400
commit8855a32044f53c5aa39feac305cd357a39f90d90 (patch)
treefac6db80df678edd802e189f6dddb6dcc290c18b /src
parentFixed bug in static linking boost on MINGW (diff)
parentMerge pull request #238 (diff)
downloadmonero-8855a32044f53c5aa39feac305cd357a39f90d90.tar.xz
Merge upstream to daemonize changes
Preparation for PR
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_config.h4
-rw-r--r--src/cryptonote_core/blockchain_storage.cpp9
-rw-r--r--src/cryptonote_core/checkpoints_create.cpp1
-rw-r--r--src/cryptonote_core/cryptonote_basic_impl.cpp4
-rw-r--r--src/mnemonics/english.h4
-rw-r--r--src/wallet/wallet_rpc_server.cpp2
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h2
7 files changed, 20 insertions, 6 deletions
diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h
index e26945086..e5df844e7 100644
--- a/src/cryptonote_config.h
+++ b/src/cryptonote_config.h
@@ -51,6 +51,7 @@
// MONEY_SUPPLY - total number coins to be generated
#define MONEY_SUPPLY ((uint64_t)(-1))
#define EMISSION_SPEED_FACTOR (20)
+#define FINAL_SUBSIDY_PER_MINUTE ((uint64_t)300000000000) // 3 * pow(10, 11)
#define CRYPTONOTE_REWARD_BLOCKS_WINDOW 100
#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE 20000 //size of block (bytes) after which reward for block calculated using block size
@@ -61,9 +62,6 @@
#define FEE_PER_KB ((uint64_t)10000000000) // pow(10, 10)
-// temporarily to allow backward compatibility during the switch to per-kb
-//#define MINING_ALLOWED_LEGACY_FEE ((uint64_t)100000000000) // pow(10, 11)
-
#define ORPHANED_BLOCKS_MAX_COUNT 100
diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp
index 35819dd3c..72dd35df7 100644
--- a/src/cryptonote_core/blockchain_storage.cpp
+++ b/src/cryptonote_core/blockchain_storage.cpp
@@ -1710,7 +1710,14 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt
bei.bl = bl;
bei.block_cumulative_size = cumulative_block_size;
bei.cumulative_difficulty = current_diffic;
- bei.already_generated_coins = already_generated_coins + base_reward;
+
+ // In the "tail" state when the minimum subsidy (implemented in get_block_reward) is in effect, the number of
+ // coins will eventually exceed MONEY_SUPPLY and overflow a uint64. To prevent overflow, cap already_generated_coins
+ // at MONEY_SUPPLY. already_generated_coins is only used to compute the block subsidy and MONEY_SUPPLY yields a
+ // subsidy of 0 under the base formula and therefore the minimum subsidy >0 in the tail state.
+
+ bei.already_generated_coins = base_reward < (MONEY_SUPPLY-already_generated_coins) ? already_generated_coins + base_reward : MONEY_SUPPLY;
+
if(m_blocks.size())
bei.cumulative_difficulty += m_blocks.back().cumulative_difficulty;
diff --git a/src/cryptonote_core/checkpoints_create.cpp b/src/cryptonote_core/checkpoints_create.cpp
index 9a21baac5..2cc9a8164 100644
--- a/src/cryptonote_core/checkpoints_create.cpp
+++ b/src/cryptonote_core/checkpoints_create.cpp
@@ -76,6 +76,7 @@ bool create_checkpoints(cryptonote::checkpoints& checkpoints)
ADD_CHECKPOINT(231350, "b5add137199b820e1ea26640e5c3e121fd85faa86a1e39cf7e6cc097bdeb1131");
ADD_CHECKPOINT(232150, "955de8e6b6508af2c24f7334f97beeea651d78e9ade3ab18fec3763be3201aa8");
ADD_CHECKPOINT(249380, "654fb0a81ce3e5caf7e3264a70f447d4bd07586c08fa50f6638cc54da0a52b2d");
+ ADD_CHECKPOINT(460000, "75037a7aed3e765db96c75bcf908f59d690a5f3390baebb9edeafd336a1c4831");
return true;
}
diff --git a/src/cryptonote_core/cryptonote_basic_impl.cpp b/src/cryptonote_core/cryptonote_basic_impl.cpp
index a7416a7e4..f2d862e57 100644
--- a/src/cryptonote_core/cryptonote_basic_impl.cpp
+++ b/src/cryptonote_core/cryptonote_basic_impl.cpp
@@ -60,6 +60,10 @@ namespace cryptonote {
//-----------------------------------------------------------------------------------------------
bool get_block_reward(size_t median_size, size_t current_block_size, uint64_t already_generated_coins, uint64_t &reward) {
uint64_t base_reward = (MONEY_SUPPLY - already_generated_coins) >> EMISSION_SPEED_FACTOR;
+ if (base_reward < FINAL_SUBSIDY_PER_MINUTE)
+ {
+ base_reward = FINAL_SUBSIDY_PER_MINUTE;
+ }
//make it soft
if (median_size < CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE) {
diff --git a/src/mnemonics/english.h b/src/mnemonics/english.h
index e70849fda..fee428817 100644
--- a/src/mnemonics/english.h
+++ b/src/mnemonics/english.h
@@ -728,7 +728,7 @@ namespace Language
"initiate",
"injury",
"inkling",
- "incline",
+ "inline",
"inmate",
"innocent",
"inorganic",
@@ -1073,7 +1073,7 @@ namespace Language
"ouch",
"ought",
"ounce",
- "launchpad",
+ "ourselves",
"oust",
"outbreak",
"oval",
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index f856e5b8a..e7940d57b 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -431,11 +431,13 @@ namespace tools
{
transfers_found = true;
}
+ auto txBlob = t_serializable_object_to_blob(td.m_tx);
wallet_rpc::transfer_details rpc_transfers;
rpc_transfers.amount = td.amount();
rpc_transfers.spent = td.m_spent;
rpc_transfers.global_index = td.m_global_output_index;
rpc_transfers.tx_hash = boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(td.m_tx));
+ rpc_transfers.tx_size = txBlob.size();
res.transfers.push_back(rpc_transfers);
}
}
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index 44bb54c97..35783a189 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -228,12 +228,14 @@ namespace wallet_rpc
bool spent;
uint64_t global_index;
std::string tx_hash;
+ uint64_t tx_size;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(amount)
KV_SERIALIZE(spent)
KV_SERIALIZE(global_index)
KV_SERIALIZE(tx_hash)
+ KV_SERIALIZE(tx_size)
END_KV_SERIALIZE_MAP()
};