Make RBF rustdoc more scrary

In order to really bring the security risks of RBF to peoples attention
make the docs more scary.
This commit is contained in:
Tobin C. Harding 2022-11-08 07:43:27 +11:00
parent c9a49d5be7
commit 26be9ddd27
1 changed files with 6 additions and 2 deletions

View File

@ -864,9 +864,13 @@ impl Transaction {
/// Returns `true` if the transaction itself opted in to be BIP-125-replaceable (RBF). /// Returns `true` if the transaction itself opted in to be BIP-125-replaceable (RBF).
/// ///
/// # Warning
///
/// **Incorrectly relying on RBF may lead to monetary loss!**
///
/// This **does not** cover the case where a transaction becomes replaceable due to ancestors /// This **does not** cover the case where a transaction becomes replaceable due to ancestors
/// being RBF. Please note that transactions may be replaced even if they do not include the RBF /// being RBF. Please note that transactions **may be replaced** even if they **do not** include
/// signal: <https://bitcoinops.org/en/newsletters/2022/10/19/#transaction-replacement-option>. /// the RBF signal: <https://bitcoinops.org/en/newsletters/2022/10/19/#transaction-replacement-option>.
pub fn is_explicitly_rbf(&self) -> bool { pub fn is_explicitly_rbf(&self) -> bool {
self.input.iter().any(|input| input.sequence.is_rbf()) self.input.iter().any(|input| input.sequence.is_rbf())
} }