Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
719b2ff0
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,发现更多精彩内容 >>
提交
719b2ff0
编写于
11月 30, 2017
作者:
K
Kevin Heifner
提交者:
Matt Witherspoon
12月 08, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #835 from EOSIO/p2p-sync-ignore-txns-stat-221-gh-833
fix for notice forwarding (reapplied on noon branch)
上级
bfa13a2c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
9 deletion
+28
-9
plugins/net_plugin/net_plugin.cpp
plugins/net_plugin/net_plugin.cpp
+28
-9
未找到文件。
plugins/net_plugin/net_plugin.cpp
浏览文件 @
719b2ff0
...
...
@@ -1509,6 +1509,7 @@ namespace eosio {
// notices of previously unknown blocks or txns,
//
fc_dlog
(
logger
,
"got a notice_message from ${p}"
,
(
"p"
,
c
->
peer_name
()));
bool
can_fwd
=
false
;
notice_message
fwd
;
request_message
req
;
bool
send_req
=
false
;
...
...
@@ -1545,15 +1546,22 @@ namespace eosio {
fc_dlog
(
logger
,
"this is a ${m} notice with ${n} blocks"
,
(
"m"
,
modes_str
(
msg
.
known_blocks
.
mode
))(
"n"
,
msg
.
known_blocks
.
pending
));
if
(
msg
.
known_blocks
.
mode
==
id_list_modes
::
last_irr_catch_up
)
{
switch
(
msg
.
known_blocks
.
mode
)
{
case
id_list_modes
::
none
:
{
elog
(
"got a block notice message with a mode of none from ${p}"
,(
"p"
,
c
->
peer_name
()));
return
;
}
case
id_list_modes
::
last_irr_catch_up
:
{
sync_master
->
start_sync
(
c
,
msg
.
known_blocks
.
pending
);
break
;
}
else
if
(
msg
.
known_blocks
.
mode
==
id_list_modes
::
catch_up
)
{
req
.
req_blocks
.
mode
=
id_list_modes
::
catch_up
;
req
.
req_blocks
.
pending
=
msg
.
known_blocks
.
pending
;
send_req
=
true
;
}
else
{
case
id_list_modes
::
catch_up
:
{
req
.
req_blocks
.
mode
=
id_list_modes
::
catch_up
;
req
.
req_blocks
.
pending
=
msg
.
known_blocks
.
pending
;
send_req
=
true
;
break
;
}
case
id_list_modes
::
normal
:
{
req
.
req_blocks
.
mode
=
normal
;
for
(
const
auto
&
blkid
:
msg
.
known_blocks
.
ids
)
{
optional
<
signed_block
>
b
;
...
...
@@ -1572,9 +1580,15 @@ namespace eosio {
req
.
req_blocks
.
ids
.
push_back
(
blkid
);
}
}
break
;
}
default:
{
elog
(
"received a bogus known_blocks.mode ${m} from ${p}"
,(
"m"
,
static_cast
<
uint32_t
>
(
msg
.
known_blocks
.
mode
))(
"p"
,
c
->
peer_name
()));
close
(
c
);
}
}
if
(
msg
.
known_trx
.
pending
==
0
&&
(
fwd
.
known_trx
.
ids
.
size
()
>
0
||
fwd
.
known_blocks
.
ids
.
size
()
>
0
)
)
{
if
(
can_fwd
)
{
send_all
(
fwd
,
[
c
,
fwd
](
connection_ptr
cptr
)
->
bool
{
return
cptr
!=
c
;
});
...
...
@@ -1743,6 +1757,10 @@ namespace eosio {
return
;
}
}
if
(
sync_master
->
syncing
()
)
{
fc_dlog
(
logger
,
"got a txn during sync - dropping"
);
return
;
}
try
{
// chain_plug->chain().validate_transaction(msg);
...
...
@@ -2020,6 +2038,7 @@ namespace eosio {
}
else
{
fc_dlog
(
logger
,
"pending_notify, mode = ${m}, pending count = ${p}"
,(
"m"
,
modes_str
(
pending_notify
.
mode
))(
"p"
,
pending_notify
.
pending
));
pending_notify
.
mode
=
normal
;
pending_notify
.
ids
.
push_back
(
txnid
);
notice_message
nm
=
{
pending_notify
,
ordered_blk_ids
(
)
};
send_all
(
nm
,
[
txn
,
txnid
](
connection_ptr
c
)
->
bool
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录