title: Getting the address of a contract deployed by another contract
body: <p>I am trying to deploy a contract from another factory contract and then return the address of the newly created contract. The address it returns however is the transaction hash not the contract address. I believe this is because the contract is not yet mined when the address is returned. When I deploy a contract using the web3 deploy it seems to wait until the contract is deployed before outputting the address.</p>
  
  <p>The factory contract:</p>
  
  <pre><code>contract Factory {
  mapping(uint256 =&gt; Contract) deployedContracts;
  uint256 numContracts;
  function Factory(){
      numContracts = 0;
  }
  
  function createContract (uint32 name) returns (address){
      deployedContracts[numContracts] = new Contract(name);
      numContracts++;
      return deployedContracts[numContracts];
  }}
  </code></pre>
  
  <p>This is how I am calling the createContract function.</p>
  
  <pre><code>factory.createContract(2,function(err, res){
          if (err){
              console.log(err)
          }else{
          console.log(res)
          }
      });
  </code></pre>