¿Dónde está el código que hace que OP_RETURN sea un tipo de transacción estándar?

Estoy mirando el historial de bitcoin github. Estoy tratando de encontrar el compromiso donde OP_RETURN se aceptó como un tx estándar. Esto se incluyó en el registro de cambios de Bitcoin Core 0.90. Cualquier ayuda sería apreciada.

Estoy mirando a través de Script Solver y veo dónde se incluye OP_RETURN como un tipo en la plantilla, pero no veo dónde devuelve verdadero para cualquier caso de datos nulos.

Gracias.

Respuestas (2)

Este es el PR que hizo que las salidas de OP_RETURN fueran estándar:

https://github.com/bitcoin/bitcoin/pull/2738

El compromiso:

https://github.com/jgarzik/bitcoin/commit/a79342479f577013f2fd2573fb32585d6f4981b3

El código actual:

https://github.com/bitcoin/bitcoin/blob/v0.11.0/src/script/standard.cpp#L56-L58

    if (GetBoolArg("-datacarrier", true))
        mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA));
    mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN));

Aquí:

bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsigned char> >& vSolutionsRet)
[...]
    // Empty, provably prunable, data-carrying output
    if (GetBoolArg("-datacarrier", true))
        mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA));
    mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN));

https://github.com/bitcoin/bitcoin/blob/ddd8d80c63182aefea56abf743bb9199d9602544/src/script/standard.cpp#L40