CTxOut::nValue
is default-initialized to -1
. The dust-threshold for OP_RETURN
outputs is 0
. Thus, the policy failure would be dust
instead of multi-op-return
. The test only passes because the dust check is currently not run.
Avoid that confusion by setting the value to 0
, to ensure the dust check passes.