Refactor sync time verification

Instead of verifying txs at sync time in every backend, its moved to
script_sync to by default be available to any backend.
This commit is contained in:
rajarshimaitra
2022-01-21 21:43:05 +05:30
parent b05ee78c73
commit 1d7ea89d8a
4 changed files with 16 additions and 51 deletions

View File

@@ -190,19 +190,6 @@ impl Blockchain for ElectrumBlockchain {
.output
.get(input.previous_output.vout as usize)
.ok_or_else(electrum_goof)?;
// Verify this input if requested via feature flag
#[cfg(feature = "verify")]
{
use crate::wallet::verify::VerifyError;
let serialized_tx = bitcoin::consensus::serialize(&tx);
bitcoinconsensus::verify(
txout.script_pubkey.to_bytes().as_ref(),
txout.value,
&serialized_tx,
input_index,
)
.map_err(|e| VerifyError::from(e))?;
}
input_index += 1;
Ok(Some(txout.clone()))
})