how to track sendtoaddress / sendmany in case of network failure Suppose you call sendmany or sendtoaddress on bitcoind RPC.

Suppose the transaction is created and send to the network, but RPC time out and sender process unable to read the txid.

Suppose there are several send to same address with same btc amount.

How this can be tracked programically?

I know you can pass comment to each send but I am unsure how I can collect it programically.
In the event that bitcoind completes a transaction, but the RPC response is lost, the transaction details will still remain available. The wallet and transaction database is updated directly by bitcoind, and will be updated regardless of the RPC state.