feat: add enable_rbf_with_sequence method on txbuilder
This commit is contained in:
parent
c79a39914e
commit
643d254ab6
@ -144,6 +144,8 @@ interface TxBuilder {
|
|||||||
|
|
||||||
TxBuilder enable_rbf();
|
TxBuilder enable_rbf();
|
||||||
|
|
||||||
|
TxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
PartiallySignedTransaction finish([ByRef] Wallet wallet);
|
PartiallySignedTransaction finish([ByRef] Wallet wallet);
|
||||||
};
|
};
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
use crate::bitcoin::{OutPoint, PartiallySignedTransaction, Transaction};
|
use crate::bitcoin::{OutPoint, PartiallySignedTransaction, Transaction};
|
||||||
use crate::descriptor::Descriptor;
|
use crate::descriptor::Descriptor;
|
||||||
use crate::types::{Balance, RbfValue};
|
|
||||||
use crate::types::ScriptAmount;
|
use crate::types::ScriptAmount;
|
||||||
|
use crate::types::{Balance, RbfValue};
|
||||||
use crate::Script;
|
use crate::Script;
|
||||||
use crate::{AddressIndex, AddressInfo, Network};
|
use crate::{AddressIndex, AddressInfo, Network};
|
||||||
|
|
||||||
use bdk::bitcoin::blockdata::script::ScriptBuf as BdkScriptBuf;
|
use bdk::bitcoin::blockdata::script::ScriptBuf as BdkScriptBuf;
|
||||||
use bdk::bitcoin::{OutPoint as BdkOutPoint, Sequence};
|
use bdk::bitcoin::{OutPoint as BdkOutPoint, Sequence};
|
||||||
|
use bdk::wallet::tx_builder::ChangeSpendPolicy;
|
||||||
use bdk::wallet::Update as BdkUpdate;
|
use bdk::wallet::Update as BdkUpdate;
|
||||||
use bdk::{Error as BdkError, FeeRate};
|
use bdk::{Error as BdkError, FeeRate};
|
||||||
use bdk::{SignOptions, Wallet as BdkWallet};
|
use bdk::{SignOptions, Wallet as BdkWallet};
|
||||||
use bdk::wallet::tx_builder::ChangeSpendPolicy;
|
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::sync::{Arc, Mutex, MutexGuard};
|
use std::sync::{Arc, Mutex, MutexGuard};
|
||||||
@ -461,15 +461,15 @@ impl TxBuilder {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// /// Enable signaling RBF with a specific nSequence value. This can cause conflicts if the wallet's descriptors contain an
|
/// Enable signaling RBF with a specific nSequence value. This can cause conflicts if the wallet's descriptors contain an
|
||||||
// /// "older" (OP_CSV) operator and the given `nsequence` is lower than the CSV value. If the `nsequence` is higher than `0xFFFFFFFD`
|
/// "older" (OP_CSV) operator and the given `nsequence` is lower than the CSV value. If the `nsequence` is higher than `0xFFFFFFFD`
|
||||||
// /// an error will be thrown, since it would not be a valid nSequence to signal RBF.
|
/// an error will be thrown, since it would not be a valid nSequence to signal RBF.
|
||||||
// pub(crate) fn enable_rbf_with_sequence(&self, nsequence: u32) -> Arc<Self> {
|
pub(crate) fn enable_rbf_with_sequence(&self, nsequence: u32) -> Arc<Self> {
|
||||||
// Arc::new(TxBuilder {
|
Arc::new(TxBuilder {
|
||||||
// rbf: Some(RbfValue::Value(nsequence)),
|
rbf: Some(RbfValue::Value(nsequence)),
|
||||||
// ..self.clone()
|
..self.clone()
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
|
|
||||||
/// Add data as an output using OP_RETURN.
|
/// Add data as an output using OP_RETURN.
|
||||||
// pub(crate) fn add_data(&self, data: Vec<u8>) -> Arc<Self> {
|
// pub(crate) fn add_data(&self, data: Vec<u8>) -> Arc<Self> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user