CTransaction currently has public data members that are marked const. Details why this is problematic, what the alternatives are, and how to fix it are given here or here.
The code is refactored using the following steps:
- Public observer functions are added to
CTransactionfor each data member. - A
bitcoin-tidycheck is added to rewrite direct data member access to use an observer function. - A "scripted-diff" that is the result of running the
bitcoin-tidycheck with-fix. - Making
CTransaction's data members private.
The result is that CTransaction has regular semantics for copy, move, and assignment. The refactoring is a prerequisite for further refactoring that will untangle the type from serialization logic (read about those plans here or here) which will result in better reasoning and faster compilation.