From 7b01a076b90cecbeea0f071b41f5e9fa818635b2 Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Fri, 20 Feb 2015 00:57:26 +0200 Subject: added tx size to incoming_transfers RPC Call --- src/wallet/wallet_rpc_server.cpp | 2 ++ src/wallet/wallet_rpc_server_commands_defs.h | 2 ++ 2 files changed, 4 insertions(+) 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(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() }; -- cgit v1.2.3 From 7590f33f9edd8f26ce38fcdd4f30fe8bcca975a9 Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Sat, 28 Feb 2015 23:32:28 +0200 Subject: move website and DNS unit tests from monero.cc to getmonero.org --- README.md | 7 ++++--- tests/unit_tests/address_from_url.cpp | 2 +- tests/unit_tests/dns_resolver.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 295d05881..2f14178e3 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ Copyright (c) 2014-2015, The Monero Project ## Development Resources -Web: [monero.cc](http://monero.cc) -Mail: [dev@monero.cc](mailto:dev@monero.cc) +Web: [getmonero.org](https://getmonero.org) +Forum: [forum.getmonero.org](https://forum.getmonero.org) +Mail: [dev@getmonero.org](mailto:dev@getmonero.org) Github (staging): [https://github.com/monero-project/bitmonero](https://github.com/monero-project/bitmonero) Github (development): [http://github.com/monero-project/bitmonero/tree/development](http://github.com/monero-project/bitmonero/tree/development) IRC: [#monero-dev on Freenode](irc://chat.freenode.net/#monero-dev) @@ -32,7 +33,7 @@ Anyone is able to contribute to Monero. If you have a fix or code change, feel f Monero development can be supported directly through donations. -Both Monero and Bitcoin donations can be made to donate.monero.cc if using a client that supports the [OpenAlias](https://openalias.org) standard +Both Monero and Bitcoin donations can be made to donate.getmonero.org if using a client that supports the [OpenAlias](https://openalias.org) standard The Monero donation address is: 46BeWrHpwXmHDpDEUmZBWZfoQpdc6HaERCNmx1pEYL2rAcuwufPN9rXHHtyUA4QVy66qeFQkn6sfK8aHYjA3jk3o1Bv16em (viewkey: e422831985c9205238ef84daf6805526c14d96fd7b059fe68c7ab98e495e5703) diff --git a/tests/unit_tests/address_from_url.cpp b/tests/unit_tests/address_from_url.cpp index cf6396e95..fe2f072de 100644 --- a/tests/unit_tests/address_from_url.cpp +++ b/tests/unit_tests/address_from_url.cpp @@ -86,7 +86,7 @@ TEST(AddressFromURL, Success) bool dnssec_result = false; - std::vector addresses = tools::wallet2::addresses_from_url("donate.monero.cc", dnssec_result); + std::vector addresses = tools::wallet2::addresses_from_url("donate.getmonero.org", dnssec_result); EXPECT_EQ(1, addresses.size()); if (addresses.size() == 1) diff --git a/tests/unit_tests/dns_resolver.cpp b/tests/unit_tests/dns_resolver.cpp index 49b31fe7a..680633778 100644 --- a/tests/unit_tests/dns_resolver.cpp +++ b/tests/unit_tests/dns_resolver.cpp @@ -108,12 +108,12 @@ TEST(DNSResolver, GetTXTRecord) { bool avail, valid; - std::vector records = tools::DNSResolver::instance().get_txt_record("donate.monero.cc", avail, valid); + std::vector records = tools::DNSResolver::instance().get_txt_record("donate.getmonero.org", avail, valid); EXPECT_NE(0, records.size()); for (auto& rec : records) { - std::cout << "TXT record for donate.monero.cc: " << rec << std::endl; + std::cout << "TXT record for donate.getmonero.org: " << rec << std::endl; } } -- cgit v1.2.3 From 10167123722e8b20a1aee0f07cf09e06e18d9ec4 Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Sun, 1 Mar 2015 00:03:57 +0200 Subject: markdown formatting fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f14178e3..31af2de95 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Copyright (c) 2014-2015, The Monero Project ## Development Resources Web: [getmonero.org](https://getmonero.org) -Forum: [forum.getmonero.org](https://forum.getmonero.org) +Forum: [forum.getmonero.org](https://forum.getmonero.org) Mail: [dev@getmonero.org](mailto:dev@getmonero.org) Github (staging): [https://github.com/monero-project/bitmonero](https://github.com/monero-project/bitmonero) Github (development): [http://github.com/monero-project/bitmonero/tree/development](http://github.com/monero-project/bitmonero/tree/development) -- cgit v1.2.3 From 10e4132e22ccc0f1a41763adee74699ebedb5ffc Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Wed, 4 Mar 2015 15:29:20 +0200 Subject: fixed English word list issue: 'incline' should have remained 'inline' --- src/mnemonics/english.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mnemonics/english.h b/src/mnemonics/english.h index e70849fda..b3147ffce 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", -- cgit v1.2.3 From c01069f35253586ac2fbc3d507c7ed3ccdd900ce Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Wed, 4 Mar 2015 15:31:24 +0200 Subject: fixed English word list issue: 'launchpad' should be 'ourselves' --- src/mnemonics/english.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mnemonics/english.h b/src/mnemonics/english.h index b3147ffce..fee428817 100644 --- a/src/mnemonics/english.h +++ b/src/mnemonics/english.h @@ -1073,7 +1073,7 @@ namespace Language "ouch", "ought", "ounce", - "launchpad", + "ourselves", "oust", "outbreak", "oval", -- cgit v1.2.3 From 754a785ee15915c4d8d81dbd55d7005e07c6407e Mon Sep 17 00:00:00 2001 From: smooth Date: Wed, 4 Mar 2015 23:35:04 -0800 Subject: minimum subsidy for mining incentives, remove unused LEGACY_FEE define --- src/cryptonote_config.h | 4 +--- src/cryptonote_core/blockchain_storage.cpp | 3 ++- src/cryptonote_core/cryptonote_basic_impl.cpp | 4 ++++ 3 files changed, 7 insertions(+), 4 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 e2b6f2326..1f35e6a5b 100644 --- a/src/cryptonote_core/blockchain_storage.cpp +++ b/src/cryptonote_core/blockchain_storage.cpp @@ -1709,7 +1709,8 @@ 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; + 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/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) { -- cgit v1.2.3 From 41a95e7b11ba9eb7ef94e1708f2407608148b8ed Mon Sep 17 00:00:00 2001 From: smooth Date: Thu, 5 Mar 2015 00:45:54 -0800 Subject: add comment about avoiding overflow --- src/cryptonote_core/blockchain_storage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp index 1f35e6a5b..42269e05c 100644 --- a/src/cryptonote_core/blockchain_storage.cpp +++ b/src/cryptonote_core/blockchain_storage.cpp @@ -1709,6 +1709,12 @@ 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; + + // 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()) -- cgit v1.2.3 From 7e72e943db5b2661c669c5631a15b595488677af Mon Sep 17 00:00:00 2001 From: smooth Date: Fri, 6 Mar 2015 02:38:06 -0800 Subject: update checkpoint --- src/cryptonote_core/checkpoints_create.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cryptonote_core/checkpoints_create.cpp b/src/cryptonote_core/checkpoints_create.cpp index 31ae9655b..9760098c8 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; } -- cgit v1.2.3