[#wallet-DiscourageFeeSniping]
= xref:wallet.adoc[wallet]::DiscourageFeeSniping
:relfileprefix: ../
:mrdocs:

Set a height&hyphen;based locktime for new transactions (uses the height of the current chain tip unless we are not synced with the current chain

== Synopsis

Declared in `&lt;wallet&sol;spend&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
DiscourageFeeSniping(
    xref:CMutableTransaction.adoc[CMutableTransaction]& tx,
    xref:FastRandomContext.adoc[FastRandomContext]& rng&lowbar;fast,
    xref:interfaces/Chain.adoc[interfaces::Chain]& chain,
    xref:uint256.adoc[uint256] const& block&lowbar;hash,
    int block&lowbar;height);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *tx*
| The transaction whose locktime is set&period;
| *rng&lowbar;fast*
| Fast random context used to occasionally randomize the locktime&period;
| *chain*
| The chain interface used to query the current tip&period;
| *block&lowbar;hash*
| The hash of the block used as the reference chain tip&period;
| *block&lowbar;height*
| The height of the block used as the reference chain tip&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
