Skip to content

Commit f8e6560

Browse files
committed
approval iteration until threshold met
1 parent 2d6fe1b commit f8e6560

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fplus-lib/src/core/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ impl LDNApplication {
574574
AppState::StartSignDatacap => {
575575
let app_file: ApplicationFile = self.file().await?;
576576
let app_lifecycle = app_file.lifecycle.finish_approval();
577+
577578
// Find the signers that already signed
578579
let current_signers = app_file
579580
.allocation
@@ -603,6 +604,11 @@ impl LDNApplication {
603604
request_id.clone(),
604605
app_lifecycle,
605606
);
607+
// If the number of current signers plus this one is less than the threshold, return early
608+
if current_signers.len() + 1 < multisig_threshold as usize {
609+
return Ok(app_file);
610+
}
611+
606612
let file_content = serde_json::to_string_pretty(&app_file).unwrap();
607613
match LDNPullRequest::add_commit_to(
608614
self.file_name.to_string(),

0 commit comments

Comments
 (0)