We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b0d786 commit 3e7c7b1Copy full SHA for 3e7c7b1
1 file changed
src/block.rs
@@ -235,6 +235,20 @@ impl BlockHeader {
235
}
236
237
238
+ /// Remove the witness data of the block header.
239
+ /// This is all the data that can be removed without changing
240
+ /// the block hash.
241
+ pub fn clear_witness(&mut self) {
242
+ match &mut self.ext {
243
+ &mut ExtData::Proof { ref mut solution, .. } => {
244
+ *solution = Script::new();
245
+ },
246
+ &mut ExtData::Dynafed { ref mut signblock_witness, .. } => {
247
+ signblock_witness.clear();
248
249
+ }
250
251
+
252
/// Calculate the root of the dynafed params. Returns [None] when not dynafed.
253
pub fn calculate_dynafed_params_root(&self) -> Option<sha256::Midstate> {
254
match self.ext {
0 commit comments