pub struct StreamedPSBT {
pub psbt: PsbtWrapper,
pub segwit_flags: Vec<bool>,
}
Expand description
A PSBT that streams input transactions one at a time instead of holding them in memory.
The PSBT is still held in memory, but the input transactions are summarized and then discarded.
segwit_flags
is a vector of booleans indicating whether we know
that the TXO is segwit.
psbt.input.witness_utxo
is populated if it is missing, and is otherwise
compared with the input transaction to ensure that it matches.
Note that if the witness flag is false, we didn’t validate witness_utxo
.
This is useful for the following use cases:
- in Lightning, where we must ensure that all outputs are segwit, or an attacker might malleate the funding transaction ID.
- if we might statelessly sign different inputs at different times, and the attacker might lie about different input amounts at different times (this is fixed in taproot).
Fields§
§psbt: PsbtWrapper
The PSBT
segwit_flags: Vec<bool>
For each input, whether we know that the TXO is segwit
Implementations§
Source§impl StreamedPSBT
impl StreamedPSBT
pub fn new(psbt: PartiallySignedTransaction) -> Self
pub fn psbt(&self) -> &PartiallySignedTransaction
pub fn consensus_decode_global<R: Read + ?Sized>( r: &mut R, ) -> Result<PartiallySignedTransaction, Error>
Trait Implementations§
Source§impl Debug for StreamedPSBT
impl Debug for StreamedPSBT
Source§impl Decodable for StreamedPSBT
impl Decodable for StreamedPSBT
Auto Trait Implementations§
impl Freeze for StreamedPSBT
impl RefUnwindSafe for StreamedPSBT
impl Send for StreamedPSBT
impl Sync for StreamedPSBT
impl Unpin for StreamedPSBT
impl UnwindSafe for StreamedPSBT
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more