提交 85887824 编写于 作者: W Wang Zhi

can not allow change bw/cpu/ram resource for hdd contract account

上级 be2e9d82
......@@ -19,6 +19,7 @@
const account_name hdd_deposit_account = N(hdddeposit12);
const account_name hdd_lock_account = N(hddlock12345);
const account_name hdd_pool_account = N(hddpool12345);
//##YTA-Change end:
#include <cmath>
......@@ -113,6 +114,10 @@ namespace eosiosystem {
require_auth( payer );
eosio_assert( quant.amount > 0, "must purchase a positive amount" );
//##YTA-Change start:
check_yta_account(receiver);
//##YTA-Change end:
auto fee = quant;
fee.amount = ( fee.amount + 199 ) / 200; /// .5% fee (round up)
// fee.amount cannot be 0 since that is only possible if quant.amount is 0 which is not allowed by the assert above.
......@@ -169,6 +174,10 @@ namespace eosiosystem {
require_auth( account );
eosio_assert( bytes > 0, "cannot sell negative byte" );
//##YTA-Change start:
check_yta_account(account);
//##YTA-Change end:
user_resources_table userres( _self, account );
auto res_itr = userres.find( account );
eosio_assert( res_itr != userres.end(), "no resource row" );
......@@ -224,6 +233,11 @@ namespace eosiosystem {
>= std::max( std::abs( stake_net_delta.amount ), std::abs( stake_cpu_delta.amount ) ),
"net and cpu deltas cannot be opposite signs" );
//##YTA-Change start:
check_yta_account(receiver);
//##YTA-Change end:
account_name source_stake_from = from;
if ( transfer ) {
from = receiver;
......@@ -445,5 +459,15 @@ namespace eosiosystem {
refunds_tbl.erase( req );
}
//##YTA-Change start:
void system_contract::check_yta_account(const account_name user) {
if(user == hdd_pool_account || user == hdd_deposit_account || user == hdd_lock_account) {
eosio_assert(1 == 2, "can not delegatebe and buy ram for this user");
}
}
//##YTA-Change end:
} //namespace eosiosystem
......@@ -316,6 +316,8 @@ namespace eosiosystem {
void update_producers_yta_totalvotes( account_name owner, double total_votes);
void delproducer( const account_name producer );
void check_yta_account( const account_name user );
//##YTA-Change end:
// Implementation details:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册