It shouldn't crash, but it did, see #139.
In order to re-use an earlier OP_RETURN transaction after a failure, at minimum the random nonce must be logged.
Ideally three input arguments are added to the script: --nonce, --txid and —op_return_message (the latter could also be inferred by fetching the transaction), allowing the script to resume.
This is also useful if you want to pay a low fee and wait a long time for confirmation.