mapValue
and vOrderForm
are opaque data structures that contain transaction metadata. It is hard to determine what actual data each field contains, and they can ostensibly be misused where metadata is added in the future without developers realizing that such metadata exists.
It’s much clearer to have all of that metadata live in their own explicit member variables within CWalletTx
. This PR implements that change.
Since the serialization format of CWalletTx
depends on mapValue
and vOrderForm
, the serialization remains unchanged, so when serializing these new members, they need to be shoved/extracted from a temporary mapValue
or vOrderForm
.
This does end up breaking forwards compatibility as unknown fields in mapValue
and vOrderForm
are stripped out if the record is rewritten. However, I don’t expect that we would continue to use these fields for future metadata, so I think that risk is low.