Skip to content

Commit c5e59a9

Browse files
committed
Remove uses of GetAdjustedTime in wallet code
This commit does not change behavior.
1 parent 6d6bcc7 commit c5e59a9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/interfaces/chain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <protocol.h>
1515
#include <sync.h>
1616
#include <threadsafety.h>
17+
#include <timedata.h>
1718
#include <txmempool.h>
1819
#include <uint256.h>
1920
#include <util/system.h>
@@ -237,6 +238,7 @@ class ChainImpl : public Chain
237238
}
238239
bool getPruneMode() override { return ::fPruneMode; }
239240
bool p2pEnabled() override { return g_connman != nullptr; }
241+
int64_t getAdjustedTime() override { return GetAdjustedTime(); }
240242
};
241243

242244
} // namespace

src/interfaces/chain.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ class Chain
164164

165165
//! Check if p2p enabled.
166166
virtual bool p2pEnabled() = 0;
167+
168+
//! Get adjusted time.
169+
virtual int64_t getAdjustedTime() = 0;
167170
};
168171

169172
//! Interface to let node manage chain clients (wallets, or maybe tools for

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
940940
wtx.BindWallet(this);
941941
bool fInsertedNew = ret.second;
942942
if (fInsertedNew) {
943-
wtx.nTimeReceived = GetAdjustedTime();
943+
wtx.nTimeReceived = chain().getAdjustedTime();
944944
wtx.nOrderPos = IncOrderPosNext(&batch);
945945
wtx.m_it_wtxOrdered = wtxOrdered.insert(std::make_pair(wtx.nOrderPos, &wtx));
946946
wtx.nTimeSmart = ComputeTimeSmart(wtx);

0 commit comments

Comments
 (0)