@@ -108,13 +108,24 @@ public class PSBT : IEquatable<PSBT>
108108 public PSBTOutputList Outputs { get ; }
109109
110110 internal UnKnownKVMap unknown = new UnKnownKVMap ( BytesComparer . Instance ) ;
111+
112+ [ Obsolete ( "Use Parse(_,_,RBF)" ) ]
111113 public static PSBT Parse ( string hexOrBase64 , Network network )
114+ {
115+ return Parse ( hexOrBase64 , network , false ) ;
116+ }
117+ [ Obsolete ( "Use Parse(_,_,RBF)" ) ]
118+ public static PSBT Parse ( string hexOrBase64 , ConsensusFactory consensusFactory )
119+ {
120+ return Parse ( hexOrBase64 , consensusFactory , false ) ;
121+ }
122+ public static PSBT Parse ( string hexOrBase64 , Network network , bool RBF )
112123 {
113124 if ( network == null )
114125 throw new ArgumentNullException ( nameof ( network ) ) ;
115- return Parse ( hexOrBase64 , network . Consensus . ConsensusFactory ) ;
126+ return Parse ( hexOrBase64 , network . Consensus . ConsensusFactory , RBF ) ;
116127 }
117- public static PSBT Parse ( string hexOrBase64 , ConsensusFactory consensusFactory )
128+ public static PSBT Parse ( string hexOrBase64 , ConsensusFactory consensusFactory , bool RBF )
118129 {
119130 if ( hexOrBase64 == null )
120131 throw new ArgumentNullException ( nameof ( hexOrBase64 ) ) ;
@@ -126,21 +137,31 @@ public static PSBT Parse(string hexOrBase64, ConsensusFactory consensusFactory)
126137 else
127138 raw = Encoders . Base64 . DecodeData ( hexOrBase64 ) ;
128139
129- return Load ( raw , consensusFactory ) ;
140+ return Load ( raw , consensusFactory , RBF ) ;
130141 }
142+ [ Obsolete ( "Use Load(_,_,RBF)" ) ]
131143 public static PSBT Load ( byte [ ] rawBytes , Network network )
144+ {
145+ return Load ( rawBytes , network , false ) ;
146+ }
147+ public static PSBT Load ( byte [ ] rawBytes , Network network , bool RBF )
132148 {
133149 if ( network == null )
134150 throw new ArgumentNullException ( nameof ( network ) ) ;
135- return Load ( rawBytes , network . Consensus . ConsensusFactory ) ;
151+ return Load ( rawBytes , network . Consensus . ConsensusFactory , RBF ) ;
136152 }
153+ [ Obsolete ( "Use Load(_,_,RBF)" ) ]
137154 public static PSBT Load ( byte [ ] rawBytes , ConsensusFactory consensusFactory )
155+ {
156+ return Load ( rawBytes , consensusFactory , false ) ;
157+ }
158+ public static PSBT Load ( byte [ ] rawBytes , ConsensusFactory consensusFactory , bool RBF )
138159 {
139160 if ( rawBytes == null )
140161 throw new ArgumentNullException ( nameof ( rawBytes ) ) ;
141162 var stream = new BitcoinStream ( rawBytes ) ;
142163 stream . ConsensusFactory = consensusFactory ;
143- var ret = new PSBT ( stream ) ;
164+ var ret = new PSBT ( stream , RBF ) ;
144165 return ret ;
145166 }
146167
@@ -162,7 +183,7 @@ private PSBT(Transaction transaction)
162183 }
163184 }
164185
165- internal PSBT ( BitcoinStream stream )
186+ internal PSBT ( BitcoinStream stream , bool RBF )
166187 {
167188 Inputs = new PSBTInputList ( ) ;
168189 Outputs = new PSBTOutputList ( ) ;
@@ -186,7 +207,7 @@ internal PSBT(BitcoinStream stream)
186207 throw new FormatException ( "Invalid PSBT. Contains illegal value in key global tx" ) ;
187208 if ( tx != null )
188209 throw new FormatException ( "Duplicate Key, unsigned tx already provided" ) ;
189- tx = stream . ConsensusFactory . CreateTransaction ( ) ;
210+ tx = stream . ConsensusFactory . CreateTransaction ( RBF ) ;
190211 uint size = 0 ;
191212 stream . ReadWriteAsVarInt ( ref size ) ;
192213 var pos = stream . Counter . ReadenBytes ;
0 commit comments