public List < ECKey > getPubKeys ( ) { if ( ! ScriptPattern . isSentToMultisig ( this ) ) throw new ScriptException ( ScriptError . SCRIPT_ERR_UNKNOWN_ERROR , "Only usable for multisig scripts." ) ; ArrayList < ECKey > result = Lists . newArrayList ( ) ; int numKeys = Script . decodeFromOpN ( chunks . get ( chunks . size ( ) - 2 ) . opcode ) ; for ( int i = 0 ; i < numKeys ; i ++ ) result . ( ECKey . fromPublicOnly ( chunks . get ( 1 + i ) . data ) ) ; return result ; }
Returns a list of the keys required by this script assuming a multi - sig script .