From fd94046eb65fb47fed82703a8d332faee99ed170 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Tue, 30 Jun 2015 18:43:25 -0400 Subject: [PATCH] Fix integer overflow errors, work around msvc parser bugs. --- libraries/chain/db_block.cpp | 7 +++++++ libraries/chain/include/graphene/chain/types.hpp | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index 6c749a8e..9d9e3bdb 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -453,7 +453,10 @@ processed_transaction database::_apply_transaction( const signed_transaction& tr eval_state._sigs.reserve( trx.signatures.size() ); for( const auto& sig : trx.signatures ) + { FC_ASSERT( eval_state._sigs.insert( std::make_pair( public_key_type(fc::ecc::public_key( sig, trx.digest() )), false) ).second, "Multiple signatures by same key detected" ) ; + } + } //If we're skipping tapos check, but not dupe check, assume all transactions have maximum expiration time. @@ -531,9 +534,11 @@ processed_transaction database::_apply_transaction( const signed_transaction& tr eval_state._sigs.reserve( trx.signatures.size() ); for( const auto& sig : trx.signatures ) + { FC_ASSERT(eval_state._sigs.insert( std::make_pair(public_key_type(fc::ecc::public_key(sig, trx.digest(tapos_block_summary.block_id) )), false)).second, "Multiple signatures by same key detected"); + } } //Verify TaPoS block summary has correct ID prefix, and that this block's time is not past the expiration @@ -579,7 +584,9 @@ processed_transaction database::_apply_transaction( const signed_transaction& tr if( !(skip & (skip_transaction_signatures|skip_authority_check)) ) { for( const auto& item : eval_state._sigs ) + { FC_ASSERT( item.second, "All signatures must be used", ("item",item) ); + } } return ptrx; diff --git a/libraries/chain/include/graphene/chain/types.hpp b/libraries/chain/include/graphene/chain/types.hpp index b9277c72..628f4de1 100644 --- a/libraries/chain/include/graphene/chain/types.hpp +++ b/libraries/chain/include/graphene/chain/types.hpp @@ -357,9 +357,9 @@ namespace graphene { namespace chain { uint64_t account_len6_fee = 5*UINT64_C(500000000); ///< about $50 uint64_t account_len5_fee = 5*UINT64_C(1000000000); ///< about $100 uint64_t account_len4_fee = 5*UINT64_C(2000000000); ///< about $200 - uint64_t account_len3_fee = 5*3000000000; ///< about $300 - uint64_t account_len2_fee = 5*4000000000; ///< about $400 - uint64_t asset_create_fee = 5ll*500000000; ///< about $35 for LTM, the cost to register the cheapest asset + uint64_t account_len3_fee = 5*UINT64_C(3000000000); ///< about $300 + uint64_t account_len2_fee = 5*UINT64_C(4000000000); ///< about $400 + uint64_t asset_create_fee = 5*UINT64_C(500000000); ///< about $35 for LTM, the cost to register the cheapest asset uint64_t asset_update_fee = 150000; ///< the cost to modify a registered asset uint64_t asset_issue_fee = 700000; ///< the cost to print a UIA and send it to an account uint64_t asset_burn_fee = 1500000; ///< the cost to burn an asset