Skip to content

Commit

Permalink
Merge pull request fedimint#6376 from joschisan/insert_new_entry
Browse files Browse the repository at this point in the history
fix: upgrade warn to a panic
  • Loading branch information
joschisan authored Nov 17, 2024
2 parents 03a7a94 + 4c643aa commit e493ea4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions fedimint-core/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,12 +1124,7 @@ where
K::Value: MaybeSend + MaybeSync,
{
if let Some(prev) = self.insert_entry(key, value).await {
debug_assert!(
false,
"Database overwriting element when expecting insertion of new entry. Key: {key:?} Prev Value: {prev:?}"
);
warn!(
target: LOG_DB,
panic!(
"Database overwriting element when expecting insertion of new entry. Key: {key:?} Prev Value: {prev:?}"
);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/fedimint-lnv2-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl ServerModule for Lightning {
return Err(LightningInputError::InvalidPreimage);
}

dbtx.insert_new_entry(&PreimageKey(*contract_id), preimage)
dbtx.insert_entry(&PreimageKey(*contract_id), preimage)
.await;

contract.claim_pk
Expand Down

0 comments on commit e493ea4

Please sign in to comment.