@@ -125,21 +125,20 @@ pub(crate) mod conduct_chain {
125
125
. unwrap ( ) ;
126
126
127
127
self . darkside_connector
128
- . stage_blocks_create ( height_before as i32 + 1 , blocks_to_add - 1 , 0 )
128
+ . stage_blocks_create ( height_before as i32 + 1 , blocks_to_add, 0 )
129
129
. await
130
130
. unwrap ( ) ;
131
131
132
+ let new_height = ( height_before as i32 + blocks_to_add) as u64 ;
133
+
132
134
loop {
133
135
let maybe_raw_tx = streamed_raw_txns. message ( ) . await . unwrap ( ) ;
134
136
match maybe_raw_tx {
135
137
None => break ,
136
138
Some ( raw_tx) => {
137
139
// increase chain height
138
140
self . darkside_connector
139
- . stage_transactions_stream ( vec ! [ (
140
- raw_tx. data. clone( ) ,
141
- u64 :: from( self . staged_blockheight) ,
142
- ) ] )
141
+ . stage_transactions_stream ( vec ! [ ( raw_tx. data. clone( ) , new_height) ] )
143
142
. await
144
143
. unwrap ( ) ;
145
144
@@ -171,8 +170,6 @@ pub(crate) mod conduct_chain {
171
170
}
172
171
}
173
172
174
- let new_height = height_before + 1 ;
175
-
176
173
//trees
177
174
let mut sapling_tree_bytes = vec ! [ ] ;
178
175
zcash_primitives:: merkle_tree:: write_commitment_tree (
@@ -187,7 +184,7 @@ pub(crate) mod conduct_chain {
187
184
)
188
185
. unwrap ( ) ;
189
186
let new_tree_state = TreeState {
190
- height : new_height,
187
+ height : new_height as u64 ,
191
188
sapling_tree : hex:: encode ( sapling_tree_bytes) ,
192
189
orchard_tree : hex:: encode ( orchard_tree_bytes) ,
193
190
network : crate :: constants:: first_tree_state ( ) . network ,
@@ -200,7 +197,7 @@ pub(crate) mod conduct_chain {
200
197
. unwrap ( ) ;
201
198
202
199
self . darkside_connector
203
- . apply_staged ( height_before as i32 + blocks_to_add )
200
+ . apply_staged ( new_height as i32 )
204
201
. await
205
202
. unwrap ( ) ;
206
203
}
0 commit comments