Skip to content

Commit 973d8ba

Browse files
committed
wallet: refactor: inline function WriteOrderPos()
Since accounts were removed in commit c9c32e6, this function is only called at one place and thus can be as well inlined.
1 parent 65ed198 commit 973d8ba

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/wallet/transaction.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919

2020
typedef std::map<std::string, std::string> mapValue_t;
2121

22-
23-
static inline void WriteOrderPos(const int64_t& nOrderPos, mapValue_t& mapValue)
24-
{
25-
if (nOrderPos == -1)
26-
return;
27-
mapValue["n"] = ToString(nOrderPos);
28-
}
29-
3022
/** Legacy class used for deserializing vtxPrev for backwards compatibility.
3123
* vtxPrev was removed in commit 93a18a3650292afbb441a47d1fa1b94aeb0164e3,
3224
* but old wallet.dat files may still contain vtxPrev vectors of CMerkleTxs.
@@ -181,7 +173,9 @@ class CWalletTx
181173
mapValue_t mapValueCopy = mapValue;
182174

183175
mapValueCopy["fromaccount"] = "";
184-
WriteOrderPos(nOrderPos, mapValueCopy);
176+
if (nOrderPos != -1) {
177+
mapValueCopy["n"] = ToString(nOrderPos);
178+
}
185179
if (nTimeSmart) {
186180
mapValueCopy["timesmart"] = strprintf("%u", nTimeSmart);
187181
}

0 commit comments

Comments
 (0)