fad5decb1fdab249f626c6468174c50be15f14cf
Could remove this and inline CMerkleTx::Unserialize
, see:
0--- a/src/wallet/wallet.h
1+++ b/src/wallet/wallet.h
2@@ -365,26 +365,6 @@ struct COutputEntry
3 int vout;
4 };
5
6-/** Legacy class used for deserializing vtxPrev for backwards compatibility.
7- * vtxPrev was removed in commit 93a18a3650292afbb441a47d1fa1b94aeb0164e3,
8- * but old wallet.dat files may still contain vtxPrev vectors of CMerkleTxs.
9- * These need to get deserialized for field alignment when deserializing
10- * a CWalletTx, but the deserialized values are discarded.**/
11-class CMerkleTx
12-{
13-public:
14- template<typename Stream>
15- void Unserialize(Stream& s)
16- {
17- CTransactionRef tx;
18- uint256 hashBlock;
19- std::vector<uint256> vMerkleBranch;
20- int nIndex;
21-
22- s >> tx >> hashBlock >> vMerkleBranch >> nIndex;
23- }
24-};
25-
26 //Get the marginal bytes of spending the specified output
27 int CalculateMaximumSignedInputSize(const CTxOut& txout, const CWallet* pwallet, bool use_max_sig = false);
28
29@@ -512,9 +492,17 @@ public:
30 Init(nullptr);
31
32 std::vector<uint256> dummy_vector1; //!< Used to be vMerkleBranch
33- std::vector<CMerkleTx> dummy_vector2; //!< Used to be vtxPrev
34 char dummy_char; //! Used to be fSpent
35- s >> tx >> hashBlock >> dummy_vector1 >> nIndex >> dummy_vector2 >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> fFromMe >> dummy_char;
36+ s >> tx >> hashBlock >> dummy_vector1 >> nIndex;
37+ {
38+ CTransactionRef tx;
39+ uint256 hashBlock;
40+ std::vector<uint256> vMerkleBranch;
41+ int nIndex;
42+
43+ s >> tx >> hashBlock >> vMerkleBranch >> nIndex; //!< Used to be vtxPrev
44+ }
45+ s >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> fFromMe >> dummy_char;
46
47 ReadOrderPos(nOrderPos, mapValue);
48 nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(mapValue["timesmart"]) : 0;
And if you do so then I’d squash now that CMerkleTx
is actually removed.