From d52bef064003ece130d754fc4096d594f626a6c4 Mon Sep 17 00:00:00 2001 From: Khaled Al-Hassanieh Date: Wed, 16 May 2018 10:32:42 -0400 Subject: [PATCH] Fixed merge error --- contracts/eosio.system/delegate_bandwidth.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/eosio.system/delegate_bandwidth.cpp b/contracts/eosio.system/delegate_bandwidth.cpp index 7dcfa5c6a..e7f405bcc 100644 --- a/contracts/eosio.system/delegate_bandwidth.cpp +++ b/contracts/eosio.system/delegate_bandwidth.cpp @@ -187,18 +187,18 @@ namespace eosiosystem { */ void system_contract::sellram( account_name account, int64_t bytes ) { require_auth( account ); - int64_t ibytes = static_cast(bytes); + eosio_assert( bytes > 0, "cannot sell negative byte" ); user_resources_table userres( _self, account ); auto res_itr = userres.find( account ); eosio_assert( res_itr != userres.end(), "no resource row" ); - eosio_assert( res_itr->ram_bytes >= ibytes, "insufficient quota" ); + eosio_assert( res_itr->ram_bytes >= bytes, "insufficient quota" ); asset tokens_out; auto itr = _rammarket.find(S(4,RAMEOS)); _rammarket.modify( itr, 0, [&]( auto& es ) { /// the cast to int64_t of bytes is safe because we certify bytes is <= quota which is limited by prior purchases - tokens_out = es.convert( asset(ibytes,S(0,RAM)), S(4,EOS) ); + tokens_out = es.convert( asset(bytes,S(0,RAM)), S(4,EOS) ); // print( "out: ", tokens_out, "\n" ); }); -- GitLab