| 755 | } |
| 756 | |
| 757 | static 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 |
no test coverage detected