Transaction with OP_RETURN rejected by bitcoind 0.9 The raw transaction below is being rejected by bitcoind 0.9.1 (error: {"code":-22,"message":"TX rejected"})

01000000015594a8c1f84b926e84d70c3a3d5e517e0c12dc07cb1a774b587121fef08f91b8000000006a47304402203ea43861e1e22603873f49e73c6ace08d32ef024e1feaca5a6242f74bf152810022044aeee3231e81d927accf20b0b0106ec327728b6a61aedd75596c5c12e5d9999012102add59262e234c0045d1f6a3d40a144b47ea0b4214916f55fb6029a079cc0b3cbffffffff0358020000000000001976a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac0000000000000000196a054f4101000111753d687474703a2f2f7265642e70696c6cd8720000000000001976a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac00000000


And the following error appears in the logs:

ERROR: AcceptToMemoryPool : nonstandard transaction: scriptpubkey


The decoded transaction uses OP_RETURN and looks like this:

{
   "lock_time":0,
   "inputs":[
      {
         "prev_out":{
            "index":0,
            "hash":"b8918ff0fe2171584b771acb07dc120c7e515e3d3a0cd7846e924bf8c1a89455"
         },
         "script":"47304402203ea43861e1e22603873f49e73c6ace08d32ef024e1feaca5a6242f74bf152810022044aeee3231e81d927accf20b0b0106ec327728b6a61aedd75596c5c12e5d9999012102add59262e234c0045d1f6a3d40a144b47ea0b4214916f55fb6029a079cc0b3cb"
      }
   ],
   "vout_sz":3,
   "hash":"4dd1b7130045f84e7dd75a03dc802063f76687812cf877dacff2a645a1b0991b",
   "vin_sz":1,
   "out":[
      {
         "address":"12QkihKUyE1hAkv7wmaMj6V3QiN8FfMvpv",
         "script_string":"OP_DUP OP_HASH160 0f763005e063382f8f4138f75cdc64d14f8ec16f OP_EQUALVERIFY OP_CHECKSIG",
         "value":600,
         "script":"76a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac"
      },
      {
         "script_string":"OP_RETURN 4f41010001 753d687474703a2f2f7265642e70696c6c",
         "value":0,
         "script":"6a054f4101000111753d687474703a2f2f7265642e70696c6c"
      },
      {
         "address":"12QkihKUyE1hAkv7wmaMj6V3QiN8FfMvpv",
         "script_string":"OP_DUP OP_HASH160 0f763005e063382f8f4138f75cdc64d14f8ec16f OP_EQUALVERIFY OP_CHECKSIG",
         "value":29400,
         "script":"76a9140f763005e063382f8f4138f75cdc64d14f8ec16f88ac"
      }
   ],
   "size":259,
   "version":1
}


However OP_RETURN is standard in Bitcoin 0.9, so why is this being rejected?

Note: This works in testnet.
I suspect that the second output is being rejected because it contains an OP_RETURN with two data pushes.  From browsing the code, "Solver" in script.cpp only categorizes output scripts as "standard" if they meet one of a limited set of templates.

All such templates containing OP_RETURN:


OP_RETURN, by itself
OP_RETURN, followed by a data push operation that pushes not more than 40 bytes onto the stack.


Since your script is "OP_RETURN, followed by a data push operation that pushes not more than 40 bytes onto the stack, followed by another data push operation", it looks like it wouldn't meet either of those templates.