Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Functions
psbt.cpp File Reference
#include <psbt.h>
#include <util/check.h>
#include <util/strencodings.h>
Include dependency graph for psbt.cpp:

Go to the source code of this file.

Functions

bool PSBTInputSigned (const PSBTInput &input)
 Checks whether a PSBTInput is already signed.
 
void UpdatePSBTOutput (const SigningProvider &provider, PartiallySignedTransaction &psbt, int index)
 Updates a PSBTOutput with information from provider.
 
bool SignPSBTInput (const SigningProvider &provider, PartiallySignedTransaction &psbt, int index, SigHashType sighash, SignatureData *out_sigdata, bool use_dummy)
 Signs a PSBTInput, verifying that all provided data matches what is being signed.
 
bool FinalizePSBT (PartiallySignedTransaction &psbtx)
 Finalizes a PSBT if possible, combining partial signatures.
 
bool FinalizeAndExtractPSBT (PartiallySignedTransaction &psbtx, CMutableTransaction &result)
 Finalizes a PSBT if possible, and extracts it to a CMutableTransaction if it could be finalized.
 
TransactionError CombinePSBTs (PartiallySignedTransaction &out, const std::vector< PartiallySignedTransaction > &psbtxs)
 Combines PSBTs with the same underlying transaction, resulting in a single PSBT with all partial signatures from each input.
 
std::string PSBTRoleName (const PSBTRole role)
 
bool DecodeBase64PSBT (PartiallySignedTransaction &psbt, const std::string &base64_tx, std::string &error)
 Decode a base64ed PSBT into a PartiallySignedTransaction.
 
bool DecodeRawPSBT (PartiallySignedTransaction &psbt, Span< const std::byte > tx_data, std::string &error)
 Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.
 

Function Documentation

◆ CombinePSBTs()

TransactionError CombinePSBTs ( PartiallySignedTransaction out,
const std::vector< PartiallySignedTransaction > &  psbtxs 
)

Combines PSBTs with the same underlying transaction, resulting in a single PSBT with all partial signatures from each input.

Parameters
[out]outthe combined PSBT, if successful
[in]psbtxsthe PSBTs to combine
Returns
error (OK if we successfully combined the transactions, other error if they were not compatible)

Definition at line 264 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecodeBase64PSBT()

bool DecodeBase64PSBT ( PartiallySignedTransaction psbt,
const std::string &  base64_tx,
std::string &  error 
)

Decode a base64ed PSBT into a PartiallySignedTransaction.

Definition at line 296 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecodeRawPSBT()

bool DecodeRawPSBT ( PartiallySignedTransaction psbt,
Span< const std::byte tx_data,
std::string &  error 
)

Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.

Definition at line 306 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinalizeAndExtractPSBT()

bool FinalizeAndExtractPSBT ( PartiallySignedTransaction psbtx,
CMutableTransaction result 
)

Finalizes a PSBT if possible, and extracts it to a CMutableTransaction if it could be finalized.

Parameters
[in]psbtxPartiallySignedTransaction
[out]resultCMutableTransaction representing the complete transaction, if successful
Returns
True if we successfully extracted the transaction, false otherwise

Definition at line 247 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinalizePSBT()

bool FinalizePSBT ( PartiallySignedTransaction psbtx)

Finalizes a PSBT if possible, combining partial signatures.

Parameters
[in,out]psbtxPartiallySignedTransaction to finalize return True if the PSBT is now complete, false otherwise

Definition at line 232 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PSBTInputSigned()

bool PSBTInputSigned ( const PSBTInput input)

Checks whether a PSBTInput is already signed.

Definition at line 160 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PSBTRoleName()

std::string PSBTRoleName ( const PSBTRole  role)

Definition at line 279 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignPSBTInput()

bool SignPSBTInput ( const SigningProvider provider,
PartiallySignedTransaction psbt,
int  index,
SigHashType  sighash,
SignatureData out_sigdata,
bool  use_dummy 
)

Signs a PSBTInput, verifying that all provided data matches what is being signed.

Definition at line 186 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatePSBTOutput()

void UpdatePSBTOutput ( const SigningProvider provider,
PartiallySignedTransaction psbt,
int  index 
)

Updates a PSBTOutput with information from provider.

This fills in the redeem_script, witness_script, and hd_keypaths where possible.

Definition at line 164 of file psbt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: