Skip to content

txdb: Remove const annotation from blockinfo iterator type#6314

Merged
str4d merged 2 commits intozcash:masterfrom
str4d:6306-fix-iterator-type
Jan 3, 2023
Merged

txdb: Remove const annotation from blockinfo iterator type#6314
str4d merged 2 commits intozcash:masterfrom
str4d:6306-fix-iterator-type

Conversation

@str4d
Copy link
Copy Markdown
Contributor

@str4d str4d commented Jan 3, 2023

The const annotation was removed from the blockinfo type in #6192, but not from the type of its iterator. Recent Clang versions are able to handle this, but GCC 11 (and it appears older Clang versions) raise an error.

Closes #6306.

The const annotation was removed from the blockinfo type in
zcash#6192, but not from the type of its iterator. Recent Clang
versions are able to handle this, but GCC 11 (and it appears older Clang
versions) raise an error.

Closes zcash#6306.
@str4d str4d added the C-bugfix Category: This fixes a bug label Jan 3, 2023
@str4d str4d added this to the Release 5.4.0 milestone Jan 3, 2023
nuttycom
nuttycom previously approved these changes Jan 3, 2023
Copy link
Copy Markdown
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK with nonblocking comment

Comment thread src/txdb.cpp Outdated
@str4d str4d added the safe-to-build Used to send PR to prod CI environment label Jan 3, 2023
@ECC-CI ECC-CI removed the safe-to-build Used to send PR to prod CI environment label Jan 3, 2023
Copy link
Copy Markdown
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Comment thread src/txdb.cpp
CDBBatch batch(*this);
for (std::vector<std::pair<int, const CBlockFileInfo*> >::const_iterator it=fileInfo.begin(); it != fileInfo.end(); it++) {
batch.Write(make_pair(DB_BLOCK_FILES, it->first), *it->second);
for (const auto& it : fileInfo) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: this probably shouldn't be called it any more, as it's not an iterator, but no big deal.

@str4d str4d merged commit 7b1fce4 into zcash:master Jan 3, 2023
@str4d str4d deleted the 6306-fix-iterator-type branch January 3, 2023 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bugfix Category: This fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build error with 5.3.2: invalid type annotation for blockinfo iterator

3 participants