[Core] Migrate uint160 (CKeyID/CScriptID) to opaque blobs #2092
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Keep going with the migration started in #1395 and #1414.
This time migrate the whole class
uint160, so it is defined as a child ofbase_blob(essentially replaceuint160withblob_uint160), thus migratingCKeyIDandCScriptIDas well.Since opaque blobs (unlike the
arith_uintclasses) have trivial copy-assignment operator, this fixes the "scary"-Wclass-memaccesswarning reported in #2076 (tested before/after patch, with gcc v9.3.0)Bonus: this fixes also a minor bug found along the way: few places where we are checking the result of
boost::get<CKeyID>over the pointedCKeyID, which shouldn't even have abool operator(), and might even be un-initialized (though we always verifyIsValidDestinationbefore, so this is mostly redundant) instead of checking the pointer itself.