[#PaysForRBF]
= PaysForRBF
:mrdocs:

The replacement transaction must pay more fees than the original transactions&period; The additional fees must pay for the replacement&apos;s bandwidth at or above the incremental relay feerate&period;

== Synopsis

Declared in `&lt;policy&sol;rbf&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::optional&lt;std::string&gt;
PaysForRBF(
    xref:CAmount.adoc[CAmount] original&lowbar;fees,
    xref:CAmount.adoc[CAmount] replacement&lowbar;fees,
    size&lowbar;t replacement&lowbar;vsize,
    xref:CFeeRate.adoc[CFeeRate] relay&lowbar;fee,
    xref:Txid.adoc[Txid] const& txid);
----

== Return Value

error string if fees are insufficient, otherwise std&colon;&colon;nullopt&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original&lowbar;fees* [in]
| Total modified fees of original transaction(s)&period;
| *replacement&lowbar;fees* [in]
| Total modified fees of replacement transaction(s)&period;
| *replacement&lowbar;vsize* [in]
| Total virtual size of replacement transaction(s)&period;
| *relay&lowbar;fee* [in]
| The node&apos;s minimum feerate for transaction relay&period;
| *txid* [in]
| Transaction ID, included in the error message if violation occurs&period;
|===


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