Setting nTimeReceived to the adjusted time has several issues:
m_best_block_timeis set to the "unadjusted" time, thus a comparison of the two times is like comparing apples to oranges. In the worst case this opens up an attack vector where remote peers can force a premature re-broadcast of wallet txs.- The RPC documentation for
"timereceived"doesn't mention that the network adjusted time is used, possibly confusing users when the time reported by RPC is off by a few seconds compared to their local timestamp.
Fix all issues by replacing the call with GetTime(). Also a style fix: Use non-narrowing integer conversion in the RPC method.