Skip to content

Commit

Permalink
Removed duplicate code to update a map in wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
wthrajat committed Jan 23, 2024
1 parent fc9e996 commit 17d8508
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/wallet/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,8 @@ impl Wallet {
prevout: OutPoint,
contract: ScriptBuf,
) -> Result<(), WalletError> {
// let mut wallet_file_data = Wallet::load_wallet_file_data(&self.wallet_file_path[..])?;
// wallet_file_data
// .prevout_to_contract_map
// .insert(prevout, contract);
// let wallet_file = File::create(&self.wallet_file_path[..])?;
// serde_json::to_writer(wallet_file, &wallet_file_data).map_err(|e| io::Error::from(e))?;
if let Some(contract) = self.store.prevout_to_contract_map.insert(prevout, contract) {
log::debug!(target: "Wallet:cache_prevout_to_contract", "prevout-contract map updated. existing contract: {}", contract);
log::debug!(target: "Wallet:cache_prevout_to_contract", "prevout-contract map updated.\nExisting contract: {}", contract);

Check warning on line 502 in src/wallet/api.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet/api.rs#L502

Added line #L502 was not covered by tests
}
Ok(())
}
Expand Down

0 comments on commit 17d8508

Please sign in to comment.