What changed, and why it matters
This commit is a simple code cleanup: it changes three C++ data structures (PSBTInput, PSBTOutput, and PartiallySignedTransaction) from 'struct' to 'class' and adds 'public:' labels so their members remain publicly accessible. It also updates forward declarations in other header files to match. This has no functional or security effect on the Bitcoin Core software.
No security action needed. Treat as a normal refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff converts struct PSBTInput, struct PSBTOutput, and struct PartiallySignedTransaction in src/psbt.h to class declarations, inserting ‘public:’ access specifiers to preserve the existing public member layout. Forward declarations in src/external_signer.h, src/interfaces/wallet.h, and src/wallet/wallet.h are updated from ‘struct PartiallySignedTransaction’ to ‘class PartiallySignedTransaction’. In C++, struct and class are equivalent except for default member access; this change is purely stylistic/encapsulation-oriented and does not alter behavior, serialization, memory layout, or security boundaries.
Changed components
src/psbt.hsrc/external_signer.hsrc/interfaces/wallet.hsrc/wallet/wallet.hInspect captured patch +9 / −6
diff --git a/src/external_signer.h b/src/external_signer.h
index 5ba37c06..87fbbf0b 100644
--- a/src/external_signer.h
+++ b/src/external_signer.h
@@ -11,7 +11,7 @@
#include <string>
#include <vector>
-struct PartiallySignedTransaction;
+class PartiallySignedTransaction;
//! Enables interaction with an external signing device or service, such as
//! a hardware wallet. See doc/external-signer.md
diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h
index ab142080..d2116317 100644
--- a/src/interfaces/wallet.h
+++ b/src/interfaces/wallet.h
@@ -32,7 +32,7 @@ class CFeeRate;
class CKey;
enum class FeeReason;
enum class OutputType;
-struct PartiallySignedTransaction;
+class PartiallySignedTransaction;
struct bilingual_str;
namespace common {
enum class PSBTError;
diff --git a/src/psbt.h b/src/psbt.h
index 719d68d9..f6bf144a 100644
--- a/src/psbt.h
+++ b/src/psbt.h
@@ -261,8 +261,9 @@ static inline void ExpectedKeySize(const std::string& key_name, const std::vecto
}
/** A structure for PSBTs which contain per-input information */
-struct PSBTInput
+class PSBTInput
{
+public:
CTransactionRef non_witness_utxo;
CTxOut witness_utxo;
CScript redeem_script;
@@ -791,8 +792,9 @@ struct PSBTInput
};
/** A structure for PSBTs which contains per output information */
-struct PSBTOutput
+class PSBTOutput
{
+public:
CScript redeem_script;
CScript witness_script;
std::map<CPubKey, KeyOriginInfo> hd_keypaths;
@@ -1027,8 +1029,9 @@ struct PSBTOutput
};
/** A version of CTransaction with the PSBT format*/
-struct PartiallySignedTransaction
+class PartiallySignedTransaction
{
+public:
std::optional<CMutableTransaction> tx;
// We use a vector of CExtPubKey in the event that there happens to be the same KeyOriginInfos for different CExtPubKeys
// Note that this map swaps the key and values from the serialization
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index cbf3efc0..d066edf8 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -74,7 +74,7 @@ struct CBlockLocator;
struct CExtKey;
struct FlatSigningProvider;
struct KeyOriginInfo;
-struct PartiallySignedTransaction;
+class PartiallySignedTransaction;
struct SignatureData;
using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.