MCPcopy Create free account
hub / github.com/ElementsProject/elements / IsCurrentForAntiFeeSniping

Function IsCurrentForAntiFeeSniping

src/wallet/spend.cpp:757–769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

755}
756
757static bool IsCurrentForAntiFeeSniping(interfaces::Chain& chain, const uint256& block_hash)
758{
759 if (chain.isInitialBlockDownload()) {
760 return false;
761 }
762 constexpr int64_t MAX_ANTI_FEE_SNIPING_TIP_AGE = 8 * 60 * 60; // in seconds
763 int64_t block_time;
764 CHECK_NONFATAL(chain.findBlock(block_hash, FoundBlock().time(block_time)));
765 if (block_time < (GetTime() - MAX_ANTI_FEE_SNIPING_TIP_AGE)) {
766 return false;
767 }
768 return true;
769}
770
771/**
772 * Return a height-based locktime for new transactions (uses the height of the

Callers 1

Calls 4

FoundBlockClass · 0.85
GetTimeFunction · 0.85
findBlockMethod · 0.80

Tested by

no test coverage detected