@@ -56,8 +56,8 @@ pub struct PMMRHandle<T: PMMRable> {
56
56
}
57
57
58
58
impl < T : PMMRable > PMMRHandle < T > {
59
- /// Constructor to create a PMMR handle from an existing directory structure on disk.
60
- /// Creates the backend files as necessary if they do not already exist.
59
+ /// Constructor to new a PMMR handle from an existing directory structure on disk.
60
+ /// news the backend files as necessary if they do not already exist.
61
61
pub fn new < P : AsRef < Path > > (
62
62
path : P ,
63
63
prunable : bool ,
@@ -655,7 +655,7 @@ where
655
655
let rproof_pmmr =
656
656
ReadonlyPMMR :: at ( & trees. rproof_pmmr_h . backend , trees. rproof_pmmr_h . last_pos ) ;
657
657
658
- // Create a new batch here to pass into the utxo_view.
658
+ // new a new batch here to pass into the utxo_view.
659
659
// Discard it (rollback) after we finish with the utxo_view.
660
660
let batch = trees. commit_index . batch ( ) ?;
661
661
let utxo = UTXOView :: new ( header_pmmr, output_pmmr, rproof_pmmr) ;
@@ -667,7 +667,7 @@ where
667
667
/// Rewindable (but still readonly) view on the kernel MMR.
668
668
/// The underlying backend is readonly. But we permit the PMMR to be "rewound"
669
669
/// via last_pos.
670
- /// We create a new db batch for this view and discard it (rollback)
670
+ /// We new a new db batch for this view and discard it (rollback)
671
671
/// when we are done with the view.
672
672
pub fn rewindable_kernel_view < F , T > ( trees : & TxHashSet , inner : F ) -> Result < T , Error >
673
673
where
@@ -678,7 +678,7 @@ where
678
678
let kernel_pmmr =
679
679
RewindablePMMR :: at ( & trees. kernel_pmmr_h . backend , trees. kernel_pmmr_h . last_pos ) ;
680
680
681
- // Create a new batch here to pass into the kernel_view.
681
+ // new a new batch here to pass into the kernel_view.
682
682
// Discard it (rollback) after we finish with the kernel_view.
683
683
let batch = trees. commit_index . batch ( ) ?;
684
684
let header = batch. head_header ( ) ?;
@@ -712,7 +712,7 @@ where
712
712
let head = batch. head ( ) ?;
713
713
let header_head = batch. header_head ( ) ?;
714
714
715
- // create a child transaction so if the state is rolled back by itself, all
715
+ // new a child transaction so if the state is rolled back by itself, all
716
716
// index saving can be undone
717
717
let child_batch = batch. child ( ) ?;
718
718
{
@@ -817,7 +817,7 @@ where
817
817
let res: Result < T , Error > ;
818
818
let rollback: bool ;
819
819
820
- // create a child transaction so if the state is rolled back by itself, all
820
+ // new a child transaction so if the state is rolled back by itself, all
821
821
// index saving can be undone
822
822
let child_batch = batch. child ( ) ?;
823
823
@@ -961,11 +961,9 @@ impl<'a> HeaderExtension<'a> {
961
961
) ;
962
962
963
963
let header_pos = pmmr:: insertion_to_pmmr_index ( header. height + 1 ) ;
964
- self . pmmr
965
- . rewind ( header_pos, & Bitmap :: create ( ) )
966
- . map_err ( |e| {
967
- ErrorKind :: TxHashSetErr ( format ! ( "pmmr rewind for pos {}, {}" , header_pos, e) )
968
- } ) ?;
964
+ self . pmmr . rewind ( header_pos, & Bitmap :: new ( ) ) . map_err ( |e| {
965
+ ErrorKind :: TxHashSetErr ( format ! ( "pmmr rewind for pos {}, {}" , header_pos, e) )
966
+ } ) ?;
969
967
970
968
// Update our head to reflect the header we rewound to.
971
969
self . head = Tip :: from_header ( header) ;
@@ -1146,7 +1144,7 @@ impl<'a> Extension<'a> {
1146
1144
// Note: This validates and NRD relative height locks via the "recent" kernel index.
1147
1145
self . apply_kernels ( b. kernels ( ) , b. header . height , batch) ?;
1148
1146
1149
- // Update our BitmapAccumulator based on affected outputs (both spent and created ).
1147
+ // Update our BitmapAccumulator based on affected outputs (both spent and newd ).
1150
1148
self . apply_to_bitmap_accumulator ( & affected_pos) ?;
1151
1149
1152
1150
// Update the head of the extension to reflect the block we just applied.
@@ -1368,7 +1366,7 @@ impl<'a> Extension<'a> {
1368
1366
let mut affected_pos = spent_pos;
1369
1367
affected_pos. push ( self . output_pmmr . last_pos ) ;
1370
1368
1371
- // Remove any entries from the output_pos created by the block being rewound.
1369
+ // Remove any entries from the output_pos newd by the block being rewound.
1372
1370
let mut missing_count = 0 ;
1373
1371
for out in block. outputs ( ) {
1374
1372
if batch. delete_output_pos_height ( & out. commitment ( ) ) . is_err ( ) {
@@ -1426,7 +1424,7 @@ impl<'a> Extension<'a> {
1426
1424
. rewind ( output_pos, & bitmap)
1427
1425
. map_err ( |e| ErrorKind :: TxHashSetErr ( format ! ( "rproof_pmmr rewind error, {}" , e) ) ) ?;
1428
1426
self . kernel_pmmr
1429
- . rewind ( kernel_pos, & Bitmap :: create ( ) )
1427
+ . rewind ( kernel_pos, & Bitmap :: new ( ) )
1430
1428
. map_err ( |e| ErrorKind :: TxHashSetErr ( format ! ( "kernel_pmmr rewind error, {}" , e) ) ) ?;
1431
1429
Ok ( ( ) )
1432
1430
}
@@ -1741,7 +1739,7 @@ pub fn zip_read(root_dir: String, header: &BlockHeader) -> Result<File, Error> {
1741
1739
}
1742
1740
}
1743
1741
1744
- // otherwise, create the zip archive
1742
+ // otherwise, new the zip archive
1745
1743
let path_to_be_cleanup = {
1746
1744
// Temp txhashset directory
1747
1745
let temp_txhashset_path = Path :: new ( & root_dir) . join ( format ! (
@@ -1767,7 +1765,7 @@ pub fn zip_read(root_dir: String, header: &BlockHeader) -> Result<File, Error> {
1767
1765
} ;
1768
1766
1769
1767
debug ! (
1770
- "zip_read: {} at {}: created zip file: {:?}" ,
1768
+ "zip_read: {} at {}: newd zip file: {:?}" ,
1771
1769
header. hash( ) ,
1772
1770
header. height,
1773
1771
zip_path
@@ -1872,7 +1870,7 @@ fn input_pos_to_rewind(
1872
1870
head_header : & BlockHeader ,
1873
1871
batch : & Batch < ' _ > ,
1874
1872
) -> Result < Bitmap , Error > {
1875
- let mut bitmap = Bitmap :: create ( ) ;
1873
+ let mut bitmap = Bitmap :: new ( ) ;
1876
1874
let mut current = head_header. clone ( ) ;
1877
1875
while current. height > block_header. height {
1878
1876
if let Ok ( block_bitmap) = batch. get_block_input_bitmap ( & current. hash ( ) ) {
0 commit comments