@@ -226,7 +226,7 @@ struct PSBTInput
226226 // Write the utxo
227227 if (non_witness_utxo) {
228228 SerializeToVector (s, CompactSizeWriter (PSBT_IN_NON_WITNESS_UTXO));
229- OverrideStream<Stream> os ( &s, s.GetType (), s. GetVersion () | SERIALIZE_TRANSACTION_NO_WITNESS) ;
229+ OverrideStream<Stream> os{ &s, s.GetVersion () | SERIALIZE_TRANSACTION_NO_WITNESS} ;
230230 SerializeToVector (os, non_witness_utxo);
231231 }
232232 if (!witness_utxo.IsNull ()) {
@@ -315,7 +315,7 @@ struct PSBTInput
315315 const auto & [leaf_hashes, origin] = leaf_origin;
316316 SerializeToVector (s, PSBT_IN_TAP_BIP32_DERIVATION, xonly);
317317 std::vector<unsigned char > value;
318- CVectorWriter s_value (s. GetType (), s. GetVersion (), value, 0 ) ;
318+ CVectorWriter s_value{s. GetVersion (), value, 0 } ;
319319 s_value << leaf_hashes;
320320 SerializeKeyOrigin (s_value, origin);
321321 s << value;
@@ -381,7 +381,7 @@ struct PSBTInput
381381 }
382382
383383 // Type is compact size uint at beginning of key
384- SpanReader skey (s. GetType (), s. GetVersion (), key) ;
384+ SpanReader skey{s. GetVersion (), key} ;
385385 uint64_t type = ReadCompactSize (skey);
386386
387387 // Do stuff based on type
@@ -394,7 +394,7 @@ struct PSBTInput
394394 throw std::ios_base::failure (" Non-witness utxo key is more than one byte type" );
395395 }
396396 // Set the stream to unserialize with witness since this is always a valid network transaction
397- OverrideStream<Stream> os ( &s, s.GetType (), s. GetVersion () & ~SERIALIZE_TRANSACTION_NO_WITNESS) ;
397+ OverrideStream<Stream> os{ &s, s.GetVersion () & ~SERIALIZE_TRANSACTION_NO_WITNESS} ;
398398 UnserializeFromVector (os, non_witness_utxo);
399399 break ;
400400 }
@@ -590,7 +590,7 @@ struct PSBTInput
590590 } else if (key.size () != 65 ) {
591591 throw std::ios_base::failure (" Input Taproot script signature key is not 65 bytes" );
592592 }
593- SpanReader s_key (s. GetType (), s. GetVersion (), Span{key}.subspan (1 )) ;
593+ SpanReader s_key{s. GetVersion (), Span{key}.subspan (1 )} ;
594594 XOnlyPubKey xonly;
595595 uint256 hash;
596596 s_key >> xonly;
@@ -632,7 +632,7 @@ struct PSBTInput
632632 } else if (key.size () != 33 ) {
633633 throw std::ios_base::failure (" Input Taproot BIP32 keypath key is not at 33 bytes" );
634634 }
635- SpanReader s_key (s. GetType (), s. GetVersion (), Span{key}.subspan (1 )) ;
635+ SpanReader s_key{s. GetVersion (), Span{key}.subspan (1 )} ;
636636 XOnlyPubKey xonly;
637637 s_key >> xonly;
638638 std::set<uint256> leaf_hashes;
@@ -757,7 +757,7 @@ struct PSBTOutput
757757 if (!m_tap_tree.empty ()) {
758758 SerializeToVector (s, PSBT_OUT_TAP_TREE);
759759 std::vector<unsigned char > value;
760- CVectorWriter s_value (s. GetType (), s. GetVersion (), value, 0 ) ;
760+ CVectorWriter s_value{s. GetVersion (), value, 0 } ;
761761 for (const auto & [depth, leaf_ver, script] : m_tap_tree) {
762762 s_value << depth;
763763 s_value << leaf_ver;
@@ -771,7 +771,7 @@ struct PSBTOutput
771771 const auto & [leaf_hashes, origin] = leaf;
772772 SerializeToVector (s, PSBT_OUT_TAP_BIP32_DERIVATION, xonly);
773773 std::vector<unsigned char > value;
774- CVectorWriter s_value (s. GetType (), s. GetVersion (), value, 0 ) ;
774+ CVectorWriter s_value{s. GetVersion (), value, 0 } ;
775775 s_value << leaf_hashes;
776776 SerializeKeyOrigin (s_value, origin);
777777 s << value;
@@ -807,7 +807,7 @@ struct PSBTOutput
807807 }
808808
809809 // Type is compact size uint at beginning of key
810- SpanReader skey (s. GetType (), s. GetVersion (), key) ;
810+ SpanReader skey{s. GetVersion (), key} ;
811811 uint64_t type = ReadCompactSize (skey);
812812
813813 // Do stuff based on type
@@ -856,7 +856,7 @@ struct PSBTOutput
856856 }
857857 std::vector<unsigned char > tree_v;
858858 s >> tree_v;
859- SpanReader s_tree (s. GetType (), s. GetVersion (), tree_v) ;
859+ SpanReader s_tree{s. GetVersion (), tree_v} ;
860860 if (s_tree.empty ()) {
861861 throw std::ios_base::failure (" Output Taproot tree must not be empty" );
862862 }
@@ -984,7 +984,7 @@ struct PartiallySignedTransaction
984984 SerializeToVector (s, CompactSizeWriter (PSBT_GLOBAL_UNSIGNED_TX));
985985
986986 // Write serialized tx to a stream
987- OverrideStream<Stream> os ( &s, s.GetType (), s. GetVersion () | SERIALIZE_TRANSACTION_NO_WITNESS) ;
987+ OverrideStream<Stream> os{ &s, s.GetVersion () | SERIALIZE_TRANSACTION_NO_WITNESS} ;
988988 SerializeToVector (os, *tx);
989989
990990 // Write xpubs
@@ -1061,7 +1061,7 @@ struct PartiallySignedTransaction
10611061 }
10621062
10631063 // Type is compact size uint at beginning of key
1064- SpanReader skey (s. GetType (), s. GetVersion (), key) ;
1064+ SpanReader skey{s. GetVersion (), key} ;
10651065 uint64_t type = ReadCompactSize (skey);
10661066
10671067 // Do stuff based on type
@@ -1075,7 +1075,7 @@ struct PartiallySignedTransaction
10751075 }
10761076 CMutableTransaction mtx;
10771077 // Set the stream to serialize with non-witness since this should always be non-witness
1078- OverrideStream<Stream> os ( &s, s.GetType (), s. GetVersion () | SERIALIZE_TRANSACTION_NO_WITNESS) ;
1078+ OverrideStream<Stream> os{ &s, s.GetVersion () | SERIALIZE_TRANSACTION_NO_WITNESS} ;
10791079 UnserializeFromVector (os, mtx);
10801080 tx = std::move (mtx);
10811081 // Make sure that all scriptSigs and scriptWitnesses are empty
0 commit comments