diff --git a/verification/src/transaction_verifier.rs b/verification/src/transaction_verifier.rs index 11214f583f..5daf25acdb 100644 --- a/verification/src/transaction_verifier.rs +++ b/verification/src/transaction_verifier.rs @@ -546,7 +546,7 @@ impl CapacityVerifier { // withdraw transactions. // cellbase's outputs are verified by RewardVerifier // DAO withdraw transaction is verified via the type script of DAO cells - if !(self.resolved_transaction.is_cellbase() || self.valid_dao_withdraw_transaction()) { + if !self.resolved_transaction.is_cellbase() && !self.valid_dao_withdraw_transaction() { let inputs_sum = self.resolved_transaction.inputs_capacity()?; let outputs_sum = self.resolved_transaction.outputs_capacity()?; @@ -585,10 +585,16 @@ impl CapacityVerifier { .resolved_inputs .iter() .any(|cell_meta| { - cell_uses_dao_type_script( - &cell_meta.cell_output, - self.dao_type_hash.as_ref().expect("No dao system cell"), - ) + cell_meta + .cell_output + .type_() + .to_opt() + .map(|t| { + Into::::into(t.hash_type()) == Into::::into(ScriptHashType::Type) + && &t.code_hash() + == self.dao_type_hash.as_ref().expect("No dao system cell") + }) + .unwrap_or(false) }) } }