[bug] doesn't fail if checking already scanned transaction
This commit is contained in:
parent
4a72fd3129
commit
4ec25d1494
@ -84,7 +84,13 @@ fn get_script_to_secret_map(
|
|||||||
|
|
||||||
pub fn check_transaction_alone(tx: &Transaction, tweak_data: &PublicKey) -> Result<HashMap<OutPoint, OwnedOutput>> {
|
pub fn check_transaction_alone(tx: &Transaction, tweak_data: &PublicKey) -> Result<HashMap<OutPoint, OwnedOutput>> {
|
||||||
let sp_wallet = WALLET.get().ok_or(Error::msg("Wallet not initialized"))?;
|
let sp_wallet = WALLET.get().ok_or(Error::msg("Wallet not initialized"))?;
|
||||||
let updates = sp_wallet.get_wallet()?.update_wallet_with_transaction(tx, 0, *tweak_data)?;
|
let updates = match sp_wallet.get_wallet()?.update_wallet_with_transaction(tx, 0, *tweak_data) {
|
||||||
|
Ok(updates) => updates,
|
||||||
|
Err(e) => {
|
||||||
|
log::debug!("Error while checking transaction: {}", e);
|
||||||
|
HashMap::new()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if updates.len() > 0 {
|
if updates.len() > 0 {
|
||||||
sp_wallet.save()?;
|
sp_wallet.save()?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user