Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
a53fac20
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a53fac20
编写于
4月 11, 2018
作者:
K
Kevin Heifner
提交者:
GitHub
4月 11, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2328 from EOSIO/p2p-code-cleanup
P2p code cleanup
上级
1332f9f6
5b12cab8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
39 deletion
+6
-39
plugins/net_plugin/net_plugin.cpp
plugins/net_plugin/net_plugin.cpp
+6
-39
未找到文件。
plugins/net_plugin/net_plugin.cpp
浏览文件 @
a53fac20
...
...
@@ -263,8 +263,6 @@ namespace eosio {
*/
chain
::
signature_type
sign_compact
(
const
chain
::
public_key_type
&
signer
,
const
fc
::
sha256
&
digest
)
const
;
// static const fc::string logger_name;
// static fc::logger logger;
};
const
fc
::
string
logger_name
(
"net_plugin_impl"
);
...
...
@@ -492,7 +490,6 @@ namespace eosio {
void
enqueue
(
transaction_id_type
id
);
void
enqueue
(
const
net_message
&
msg
,
bool
trigger_send
=
true
);
void
cancel_sync
(
go_away_reason
);
void
cancel_fetch
();
void
flush_queues
();
bool
enqueue_sync_block
();
void
request_sync_blocks
(
uint32_t
start
,
uint32_t
end
);
...
...
@@ -518,8 +515,6 @@ namespace eosio {
* encountered unpacking or processing the message.
*/
bool
process_next_message
(
net_plugin_impl
&
impl
,
uint32_t
message_length
);
// static const fc::string logger_name;
// static fc::logger logger;
};
struct
msgHandler
:
public
fc
::
visitor
<
void
>
{
...
...
@@ -568,8 +563,6 @@ namespace eosio {
void
recv_handshake
(
connection_ptr
c
,
const
handshake_message
&
msg
);
void
recv_notice
(
connection_ptr
c
,
const
notice_message
&
msg
);
// static const fc::string logger_name;
// static fc::logger logger;
};
class
big_msg_manager
{
...
...
@@ -589,19 +582,8 @@ namespace eosio {
void
recv_notice
(
connection_ptr
conn
,
const
notice_message
&
msg
);
void
retry_fetch
(
connection_ptr
conn
);
// static const fc::string logger_name;
// static fc::logger logger;
};
// const fc::string net_plugin_impl::logger_name("net_plugin_impl");
// fc::logger net_plugin_impl::logger(net_plugin_impl::logger_name);
// const fc::string connection::logger_name("connection");
// fc::logger connection::logger(connection::logger_name);
// const fc::string sync_manager::logger_name("sync_manager");
// fc::logger sync_manager::logger(sync_manager::logger_name);
// const fc::string big_msg_manager::logger_name("big_msg_manager");
// fc::logger big_msg_manager::logger(big_msg_manager::logger_name);
//---------------------------------------------------------------------------
connection
::
connection
(
string
endpoint
)
...
...
@@ -946,10 +928,6 @@ namespace eosio {
}
}
void
connection
::
cancel_fetch
()
{
my_impl
->
big_msg_master
->
retry_fetch
(
shared_from_this
()
);
}
bool
connection
::
enqueue_sync_block
()
{
chain_controller
&
cc
=
app
().
find_plugin
<
chain_plugin
>
()
->
chain
();
if
(
!
peer_requested
)
...
...
@@ -1109,7 +1087,7 @@ namespace eosio {
//-----------------------------------------------------------
sync_manager
::
sync_manager
(
uint32_t
req_span
)
sync_manager
::
sync_manager
(
uint32_t
req_span
)
:
sync_known_lib_num
(
0
)
,
sync_last_requested_num
(
0
)
,
sync_next_expected_num
(
1
)
...
...
@@ -1547,9 +1525,10 @@ namespace eosio {
0
,
0
,
0
};
my_impl
->
local_txns
.
insert
(
std
::
move
(
nts
));
}
if
(
!
skip
&&
bufsiz
<=
just_send_it_max
)
{
my_impl
->
send_all
(
txn
,
[
remember
,
txnid
](
connection_ptr
c
)
->
bool
{
if
(
c
->
syncing
)
{
if
(
bufsiz
<=
just_send_it_max
)
{
my_impl
->
send_all
(
txn
,
[
skip
,
remember
,
txnid
](
connection_ptr
c
)
->
bool
{
if
(
c
==
skip
||
c
->
syncing
)
{
return
false
;
}
const
auto
&
bs
=
c
->
trx_state
.
find
(
txnid
);
...
...
@@ -1575,7 +1554,7 @@ namespace eosio {
const
auto
&
bs
=
c
->
trx_state
.
find
(
txnid
);
bool
unknown
=
bs
==
c
->
trx_state
.
end
();
if
(
unknown
)
{
fc_
i
log
(
logger
,
"sending notice to ${n}"
,
(
"n"
,
c
->
peer_name
()
)
);
fc_
d
log
(
logger
,
"sending notice to ${n}"
,
(
"n"
,
c
->
peer_name
()
)
);
if
(
remember
)
{
c
->
trx_state
.
insert
(
transaction_state
({
txnid
,
false
,
true
,
0
,
time_point
()
}));
}
...
...
@@ -2650,20 +2629,12 @@ namespace eosio {
// Housekeeping so fc::logger::get() will work as expected
fc
::
get_logger_map
()[
logger_name
]
=
logger
;
// fc::get_logger_map()[connection::logger_name] = connection::logger;
// fc::get_logger_map()[net_plugin_impl::logger_name] = net_plugin_impl::logger;
// fc::get_logger_map()[sync_manager::logger_name] = sync_manager::logger;
// fc::get_logger_map()[big_msg_manager::logger_name] = big_msg_manager::logger;
// Setting a parent would in theory get us the default appenders for free but
// a) the parent's log level overrides our own in that case; and
// b) fc library's logger was never finished - the _additivity flag tested is never true.
for
(
fc
::
shared_ptr
<
fc
::
appender
>&
appender
:
fc
::
logger
::
get
().
get_appenders
())
{
logger
.
add_appender
(
appender
);
// connection::logger.add_appender(appender);
// net_plugin_impl::logger.add_appender(appender);
// sync_manager::logger.add_appender(appender);
// big_msg_manager::logger.add_appender(appender);
}
if
(
options
.
count
(
"log-level-net-plugin"
)
)
{
...
...
@@ -2672,10 +2643,6 @@ namespace eosio {
fc
::
from_variant
(
options
.
at
(
"log-level-net-plugin"
).
as
<
string
>
(),
logl
);
ilog
(
"Setting net_plugin logging level to ${level}"
,
(
"level"
,
logl
));
logger
.
set_log_level
(
logl
);
// connection::logger.set_log_level(logl);
// net_plugin_impl::logger.set_log_level(logl);
// sync_manager::logger.set_log_level(logl);
// big_msg_manager::logger.set_log_level(logl);
}
my
->
network_version
=
static_cast
<
uint16_t
>
(
app
().
version
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录