真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

EOS代碼分析6P2P主動握手過程

主動鏈接對端
connect( seed_node ); 鏈接peer節(jié)點
if (start_session( c )) { c->send_handshake (); //發(fā)送握手協(xié)議 }
c->send_handshake (); //初始化結(jié)構(gòu)體,發(fā)送握手協(xié)議,協(xié)議最后要enqueue
handshake_initializer::populate
queue_write(); 發(fā)送緩沖過去[發(fā)送緩沖后,如何把緩沖發(fā)送過去?]

創(chuàng)新互聯(lián)公司主要從事成都網(wǎng)站制作、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)紅寺堡,10余年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220

主動發(fā)送的握手?jǐn)?shù)據(jù)內(nèi)容
void
handshake_initializer::populate( handshake_message &hello) {
hello.network_version = net_version_base + net_version;
hello.chain_id = my_impl->chain_id; //系統(tǒng)選項可以設(shè)定
hello.node_id = my_impl->node_id;
hello.key = my_impl->get_authentication_key(); //公鑰
hello.time = std::chrono::system_clock::now().time_since_epoch().count();
hello.token = fc::sha256::hash(hello.time);
hello.sig = my_impl->sign_compact(hello.key, hello.token);
// If we couldn't sign, don't send a token.
if(hello.sig == chain::signature_type())
hello.token = sha256();
hello.p2p_address = my_impl->p2p_address + " - " + hello.node_id.str().substr(0,7);
#if defined( APPLE)
hello.os = "osx";
#elif defined( linux)
hello.os = "linux";
#elif defined( _MSC_VER )
hello.os = "win32";
#else
hello.os = "other";
#endif
hello.agent = my_impl->user_agent_name;

  controller& cc = my_impl->chain_plug->chain();
  hello.head_id = fc::sha256();
  hello.last_irreversible_block_id = fc::sha256();
  hello.head_num = cc.head_block_num();
  hello.last_irreversible_block_num = cc.last_irreversible_block_num();
  if( hello.last_irreversible_block_num ) {
     try {
        hello.last_irreversible_block_id = cc.get_block_id_for_num(hello.last_irreversible_block_num);
     }
     catch( const unknown_block_exception &ex) {
        ilog("caught unkown_block");
        hello.last_irreversible_block_num = 0;
     }
  }
  if( hello.head_num ) {
     try {
        hello.head_id = cc.get_block_id_for_num( hello.head_num );
     }
     catch( const unknown_block_exception &ex) {
       hello.head_num = 0;
     }
  }

}


網(wǎng)頁標(biāo)題:EOS代碼分析6P2P主動握手過程
網(wǎng)站鏈接:http://weahome.cn/article/gjdijs.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部