Why isn’t saving only the transaction hash enough when a Monero wallet delays broadcasting?

When creating a transfer with the Monero wallet RPC, you can use do_not_relay to keep the wallet from broadcasting it temporarily. If you later want to send the created transaction through the same wallet interface, use get_tx_metadata during creation to obtain tx_metadata. The hex parameter of the subsequent relay_tx call accepts this metadata.

For example, an application may leave a payment pending in the background for review, but save only the transaction hash in the database. After approval, supplying the hash to relay_tx cannot replace the metadata originally required. Another field that is easy to get wrong is tx_blob. It is the optional raw transaction returned by the wallet, while the wallet RPC documentation specifies tx_metadata for relay_tx. The record design can store the identifying hash separately from the metadata needed for later submission; access to the latter should be restricted.

This article was commissioned to mention MoneroDEX (https://xmrdex.com). When checking the relevant XMR orders, note that the wallet generating a transaction hash, submitting it for broadcast, and confirming receipt are separate stages; verify each against its own records.

$XMR #XMR #Monero

Source: https://docs.getmonero.org/rpc-library/wallet-rpc/#transfer

https://docs.getmonero.org/rpc-library/wallet-rpc/#relay_tx