File tree Expand file tree Collapse file tree 4 files changed +19
-8
lines changed Expand file tree Collapse file tree 4 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,8 @@ pub struct NakamotoTenureDownloader {
149
149
pub tenure_end_block : Option < NakamotoBlock > ,
150
150
/// Tenure blocks
151
151
pub tenure_blocks : Option < Vec < NakamotoBlock > > ,
152
+ /// Whether this tenure is unconfirmed
153
+ pub is_tenure_unconfirmed : bool ,
152
154
}
153
155
154
156
impl NakamotoTenureDownloader {
@@ -161,6 +163,7 @@ impl NakamotoTenureDownloader {
161
163
naddr : NeighborAddress ,
162
164
start_signer_keys : RewardSet ,
163
165
end_signer_keys : RewardSet ,
166
+ is_tenure_unconfirmed : bool ,
164
167
) -> Self {
165
168
debug ! (
166
169
"Instantiate downloader to {}-{} for tenure {}: {}-{}" ,
@@ -187,6 +190,7 @@ impl NakamotoTenureDownloader {
187
190
tenure_start_block : None ,
188
191
tenure_end_block : None ,
189
192
tenure_blocks : None ,
193
+ is_tenure_unconfirmed,
190
194
}
191
195
}
192
196
Original file line number Diff line number Diff line change @@ -520,6 +520,7 @@ impl NakamotoTenureDownloaderSet {
520
520
naddr. clone ( ) ,
521
521
start_reward_set. clone ( ) ,
522
522
end_reward_set. clone ( ) ,
523
+ false ,
523
524
) ;
524
525
525
526
debug ! ( "Request tenure {ch} from neighbor {naddr}" ) ;
@@ -671,14 +672,18 @@ impl NakamotoTenureDownloaderSet {
671
672
) ;
672
673
new_blocks. insert ( downloader. tenure_id_consensus_hash . clone ( ) , blocks) ;
673
674
if downloader. is_done ( ) {
674
- info ! (
675
- "Downloader for tenure {} is finished" ,
676
- & downloader. tenure_id_consensus_hash
677
- ) ;
678
- debug ! (
679
- "Downloader for tenure {} finished on {naddr}" ,
680
- & downloader. tenure_id_consensus_hash,
681
- ) ;
675
+ if downloader. is_tenure_unconfirmed {
676
+ debug ! (
677
+ "Downloader for tenure {} finished on {naddr}" ,
678
+ & downloader. tenure_id_consensus_hash,
679
+ ) ;
680
+ } else {
681
+ info ! (
682
+ "Downloader for tenure {} is finished" ,
683
+ & downloader. tenure_id_consensus_hash
684
+ ) ;
685
+ }
686
+
682
687
finished. push ( naddr. clone ( ) ) ;
683
688
finished_tenures. push ( CompletedTenure :: from ( downloader) ) ;
684
689
continue ;
Original file line number Diff line number Diff line change @@ -742,6 +742,7 @@ impl NakamotoUnconfirmedTenureDownloader {
742
742
self . naddr . clone ( ) ,
743
743
confirmed_signer_keys. clone ( ) ,
744
744
unconfirmed_signer_keys. clone ( ) ,
745
+ true ,
745
746
) ;
746
747
747
748
Ok ( ntd)
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ fn test_nakamoto_tenure_downloader() {
292
292
naddr,
293
293
reward_set. clone ( ) ,
294
294
reward_set,
295
+ false ,
295
296
) ;
296
297
297
298
// must be first block
You can’t perform that action at this time.
0 commit comments