@@ -8,7 +8,7 @@ use ckb_jsonrpc_types::{
88use ckb_logger:: error;
99use ckb_shared:: shared:: Shared ;
1010use ckb_types:: core:: TransactionView ;
11- use ckb_types:: { H256 , core, packed, prelude:: * } ;
11+ use ckb_types:: { H256 , core, h256 , packed, prelude:: * } ;
1212use ckb_verification:: { Since , SinceMetric } ;
1313use jsonrpc_core:: Result ;
1414use jsonrpc_utils:: rpc;
@@ -771,7 +771,8 @@ impl<'a> WellKnownScriptsOnlyValidator<'a> {
771771 output : & packed:: CellOutput ,
772772 ) -> std:: result:: Result < ( ) , DefaultOutputsValidatorError > {
773773 self . validate_secp256k1_blake160_sighash_all ( output)
774- . or_else ( |_| self . validate_secp256k1_blake160_multisig_all ( output) )
774+ . or_else ( |_| self . validate_secp256k1_blake160_multisig_all_legacy ( output) )
775+ . or_else ( |_| self . validate_secp256k1_blake160_multisig_all_v2 ( output) )
775776 . or_else ( |_| self . validate_well_known_lock_scripts ( output) )
776777 }
777778
@@ -804,7 +805,7 @@ impl<'a> WellKnownScriptsOnlyValidator<'a> {
804805 }
805806 }
806807
807- fn validate_secp256k1_blake160_multisig_all (
808+ fn validate_secp256k1_blake160_multisig_all_legacy (
808809 & self ,
809810 output : & packed:: CellOutput ,
810811 ) -> std:: result:: Result < ( ) , DefaultOutputsValidatorError > {
@@ -834,6 +835,33 @@ impl<'a> WellKnownScriptsOnlyValidator<'a> {
834835 }
835836 }
836837
838+ fn validate_secp256k1_blake160_multisig_all_v2 (
839+ & self ,
840+ output : & packed:: CellOutput ,
841+ ) -> std:: result:: Result < ( ) , DefaultOutputsValidatorError > {
842+ let script = output. lock ( ) ;
843+ if !script. is_hash_type_data1 ( ) {
844+ Err ( DefaultOutputsValidatorError :: HashType )
845+ } else if script. code_hash ( )
846+ != h256 ! ( "0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29" ) . pack ( )
847+ {
848+ Err ( DefaultOutputsValidatorError :: CodeHash )
849+ } else if script. args ( ) . len ( ) != BLAKE160_LEN {
850+ if script. args ( ) . len ( ) == BLAKE160_LEN + SINCE_LEN {
851+ if extract_since_from_secp256k1_blake160_multisig_all_args ( & script) . flags_is_valid ( )
852+ {
853+ Ok ( ( ) )
854+ } else {
855+ Err ( DefaultOutputsValidatorError :: ArgsSince )
856+ }
857+ } else {
858+ Err ( DefaultOutputsValidatorError :: ArgsLen )
859+ }
860+ } else {
861+ Ok ( ( ) )
862+ }
863+ }
864+
837865 fn validate_well_known_lock_scripts (
838866 & self ,
839867 output : & packed:: CellOutput ,
0 commit comments