Skip to content

Commit cbb6419

Browse files
committed
Webwallet orphaned blocks fixes
1 parent 16e9123 commit cbb6419

File tree

2 files changed

+484
-34
lines changed

2 files changed

+484
-34
lines changed

extensions/bug-fixes.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,38 @@
8686
}
8787
]
8888
},
89+
{
90+
"path": "/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp",
91+
"changes": [
92+
{
93+
"description": "Fix getinfo incorrect last_known_block_index when malicious is in place",
94+
"action": "add_below",
95+
"marker": "m_observedHeight = std::max(peerHeight, m_core.getTopBlockIndex() + 1);",
96+
"parameters": {
97+
"text": [
98+
" if (context.m_state == CryptoNoteConnectionContext::state_normal) {",
99+
" m_observedHeight = m_core.getTopBlockIndex();",
100+
" }"
101+
]
102+
}
103+
},
104+
{
105+
"description": "Fix getinfo incorrect last_known_block_index when malicious is in place",
106+
"action": "replace",
107+
"marker": "if (peerHeight > context.m_remote_blockchain_height) {",
108+
"parameters": {
109+
"text": [
110+
" if (context.m_remote_blockchain_height != 0 && context.m_last_response_height <= context.m_remote_blockchain_height) {",
111+
" m_observedHeight = context.m_remote_blockchain_height ;",
112+
" if (m_observedHeight != height) {",
113+
" updated = true;",
114+
" }",
115+
" } else if (peerHeight > context.m_remote_blockchain_height) {"
116+
]
117+
}
118+
}
119+
]
120+
},
89121
{
90122
"path": "/src/crypto/crypto.h",
91123
"changes": [

0 commit comments

Comments
 (0)