mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
psbt: Remove unused IsNull() methods
Co-authored-by: jeanpablojp <8968629+jeanpablojp@users.noreply.github.com>
This commit is contained in:
15
src/psbt.cpp
15
src/psbt.cpp
@@ -31,11 +31,6 @@ PartiallySignedTransaction::PartiallySignedTransaction(const CMutableTransaction
|
||||
}
|
||||
}
|
||||
|
||||
bool PartiallySignedTransaction::IsNull() const
|
||||
{
|
||||
return inputs.empty() && outputs.empty() && unknown.empty();
|
||||
}
|
||||
|
||||
bool PartiallySignedTransaction::Merge(const PartiallySignedTransaction& psbt)
|
||||
{
|
||||
// Prohibited to merge two PSBTs over different transactions
|
||||
@@ -289,11 +284,6 @@ COutPoint PSBTInput::GetOutPoint() const
|
||||
return COutPoint(prev_txid, prev_out);
|
||||
}
|
||||
|
||||
bool PSBTInput::IsNull() const
|
||||
{
|
||||
return !non_witness_utxo && witness_utxo.IsNull() && partial_sigs.empty() && unknown.empty() && hd_keypaths.empty() && redeem_script.empty() && witness_script.empty();
|
||||
}
|
||||
|
||||
void PSBTInput::FillSignatureData(SignatureData& sigdata) const
|
||||
{
|
||||
if (!final_script_sig.empty()) {
|
||||
@@ -528,11 +518,6 @@ void PSBTOutput::FromSignatureData(const SignatureData& sigdata)
|
||||
m_musig2_participants.insert(sigdata.musig2_pubkeys.begin(), sigdata.musig2_pubkeys.end());
|
||||
}
|
||||
|
||||
bool PSBTOutput::IsNull() const
|
||||
{
|
||||
return redeem_script.empty() && witness_script.empty() && hd_keypaths.empty() && unknown.empty();
|
||||
}
|
||||
|
||||
bool PSBTOutput::Merge(const PSBTOutput& output)
|
||||
{
|
||||
hd_keypaths.insert(output.hd_keypaths.begin(), output.hd_keypaths.end());
|
||||
|
||||
@@ -321,7 +321,6 @@ public:
|
||||
std::set<PSBTProprietary> m_proprietary;
|
||||
std::optional<int> sighash_type;
|
||||
|
||||
bool IsNull() const;
|
||||
void FillSignatureData(SignatureData& sigdata) const;
|
||||
void FromSignatureData(const SignatureData& sigdata);
|
||||
[[nodiscard]] bool Merge(const PSBTInput& input);
|
||||
@@ -956,7 +955,6 @@ public:
|
||||
CAmount amount;
|
||||
CScript script;
|
||||
|
||||
bool IsNull() const;
|
||||
void FillSignatureData(SignatureData& sigdata) const;
|
||||
void FromSignatureData(const SignatureData& sigdata);
|
||||
[[nodiscard]] bool Merge(const PSBTOutput& output);
|
||||
@@ -1254,7 +1252,6 @@ public:
|
||||
uint32_t tx_version;
|
||||
std::optional<uint32_t> fallback_locktime;
|
||||
|
||||
bool IsNull() const;
|
||||
uint32_t GetVersion() const;
|
||||
|
||||
/** Merge psbt into this. The two psbts must have the same underlying CTransaction (i.e. the
|
||||
|
||||
@@ -54,12 +54,10 @@ FUZZ_TARGET(psbt)
|
||||
(void)PSBTRoleName(input_analysis.next);
|
||||
}
|
||||
|
||||
(void)psbt.IsNull();
|
||||
(void)psbt.GetUnsignedTx();
|
||||
|
||||
for (const PSBTInput& input : psbt.inputs) {
|
||||
(void)PSBTInputSigned(input);
|
||||
(void)input.IsNull();
|
||||
PSBTInput input_mod = input;
|
||||
CTxOut tx_out;
|
||||
if (input.GetUTXO(tx_out)) {
|
||||
@@ -96,7 +94,6 @@ FUZZ_TARGET(psbt)
|
||||
(void)CountPSBTUnsignedInputs(psbt);
|
||||
|
||||
for (const PSBTOutput& output : psbt.outputs) {
|
||||
(void)output.IsNull();
|
||||
PSBTOutput output_mod = output;
|
||||
// A PSBT output must roundtrip to signature data.
|
||||
PSBTOutput output_fill{psbt_version, output_mod.amount, output_mod.script};
|
||||
|
||||
Reference in New Issue
Block a user