@@ -108,20 +108,14 @@ namespace golos { namespace chain {
108108 }
109109
110110 void account_create_evaluator::do_apply (const account_create_operation &o) {
111- database &_db = db ();
112- const auto &creator = _db.get_account (o.creator );
113-
114- const auto &props = _db.get_dynamic_global_properties ();
115- const auto & median_props = _db.get_witness_schedule_object ().median_props ;
111+ const auto & creator = _db.get_account (o.creator );
116112
117- FC_ASSERT (creator.balance >=
118- o. fee , " Insufficient balance to create account." , (" creator.balance" , creator.balance )(" required" , o.fee ));
113+ FC_ASSERT (creator.balance >= o. fee ,
114+ " Insufficient balance to create account." , (" creator.balance" , creator.balance )(" required" , o.fee ));
119115
120116 if (_db.has_hardfork (STEEMIT_HARDFORK_0_1 )) {
121- auto min_fee = _db.get_witness_schedule_object ().median_props .account_creation_fee ;
122- if (_db.has_hardfork (STEEMIT_HARDFORK_0_18__535 )) {
123- min_fee *= median_props.create_account_with_golos_modifier ;
124- }
117+ const auto & median_props = _db.get_witness_schedule_object ().median_props ;
118+ auto min_fee = median_props.account_creation_fee ;
125119 FC_ASSERT (o.fee >= min_fee,
126120 " Insufficient Fee: ${f} required, ${p} provided." , (" f" , min_fee)(" p" , o.fee ));
127121 }
@@ -145,6 +139,7 @@ namespace golos { namespace chain {
145139 c.balance -= o.fee ;
146140 });
147141
142+ const auto & props = _db.get_dynamic_global_properties ();
148143 const auto & new_account = _db.create <account_object>([&](account_object& acc) {
149144 acc.name = o.new_account_name ;
150145 acc.memo_key = o.memo_key ;
@@ -187,18 +182,20 @@ namespace golos { namespace chain {
187182
188183 const auto & v_share_price = _db.get_dynamic_global_properties ().get_vesting_share_price ();
189184 const auto & median_props = _db.get_witness_schedule_object ().median_props ;
190- auto target_delegation =
191- median_props.create_account_delegation_ratio *
192- median_props.create_account_with_golos_modifier *
193- median_props.account_creation_fee * v_share_price;
194- auto current_delegation =
195- median_props.create_account_delegation_ratio * o.fee * v_share_price + o.delegation ;
185+ const auto target = median_props.create_account_min_golos_fee + median_props.create_account_min_delegation ;
186+ auto target_delegation = target * v_share_price;
187+ auto min_fee = median_props.account_creation_fee .amount .value ;
188+ #ifdef STEEMIT_BUILD_TESTNET
189+ if (!min_fee)
190+ min_fee = 1 ;
191+ #endif
192+ auto current_delegation = o.fee * target.amount .value / min_fee * v_share_price + o.delegation ;
196193
197194 FC_ASSERT (current_delegation >= target_delegation,
198195 " Inssufficient Delegation ${f} required, ${p} provided." ,
199196 (" f" , target_delegation)(" p" , current_delegation)(" o.fee" , o.fee ) (" o.delegation" , o.delegation ));
200- FC_ASSERT (o.fee >= median_props.account_creation_fee ,
201- " Insufficient Fee: ${f} required, ${p} provided." , (" f" , median_props.account_creation_fee )(" p" , o.fee ));
197+ FC_ASSERT (o.fee >= median_props.create_account_min_golos_fee ,
198+ " Insufficient Fee: ${f} required, ${p} provided." , (" f" , median_props.create_account_min_golos_fee )(" p" , o.fee ));
202199
203200 for (auto & a : o.owner .account_auths ) {
204201 _db.get_account (a.first );
@@ -239,7 +236,7 @@ namespace golos { namespace chain {
239236 d.delegator = o.creator ;
240237 d.delegatee = o.new_account_name ;
241238 d.vesting_shares = o.delegation ;
242- d.min_delegation_time = now + median_props.create_account_delegation_time ;
239+ d.min_delegation_time = now + fc::seconds ( median_props.create_account_delegation_time ) ;
243240 });
244241 }
245242 if (o.fee .amount > 0 ) {
@@ -2200,8 +2197,8 @@ namespace golos { namespace chain {
22002197
22012198 const auto & median_props = _db.get_witness_schedule_object ().median_props ;
22022199 const auto v_share_price = _db.get_dynamic_global_properties ().get_vesting_share_price ();
2203- auto min_delegation = median_props.account_creation_fee * median_props. min_delegation_multiplier * v_share_price;
2204- auto min_update = median_props.account_creation_fee * v_share_price;
2200+ auto min_delegation = median_props.min_delegation * v_share_price;
2201+ auto min_update = median_props.create_account_min_golos_fee * v_share_price;
22052202
22062203 auto now = _db.head_block_time ();
22072204 auto delta = delegation ?
0 commit comments