@@ -40,8 +40,12 @@ class TransactionResponse
4040 * @param nodeId The ID of the node account to which this TransactionResponse's corresponding Transaction was sent.
4141 * @param transactionId The ID of this TransactionResponse's corresponding Transaction.
4242 * @param hash The hash of this TransactionResponse's corresponding Transaction.
43+ * @param transactionNodeAccountIds The list of node account IDs configured on the transaction at execution time.
4344 */
44- TransactionResponse (AccountId nodeId, TransactionId transactionId, std::vector<std::byte> hash);
45+ TransactionResponse (AccountId nodeId,
46+ TransactionId transactionId,
47+ std::vector<std::byte> hash,
48+ std::vector<AccountId> transactionNodeAccountIds = {});
4549
4650 /* *
4751 * Get a TransactionReceipt for this TransactionResponse's corresponding Transaction.
@@ -74,10 +78,16 @@ class TransactionResponse
7478
7579 /* *
7680 * Construct a TransactionReceiptQuery for this TransactionResponse's corresponding Transaction.
81+ * When a non-null Client is provided and its failover flag is
82+ * enabled, the query will target the submitting node first, then
83+ * other eligible nodes in deterministic order.
7784 *
85+ * @param client Optional pointer to the Client. When null or
86+ * failover is disabled, the query is pinned to the submitting
87+ * node only.
7888 * @return The constructed TransactionReceiptQuery.
7989 */
80- [[nodiscard]] TransactionReceiptQuery getReceiptQuery () const ;
90+ [[nodiscard]] TransactionReceiptQuery getReceiptQuery (const Client* client = nullptr ) const ;
8191
8292 /* *
8393 * Get a TransactionReceipt for this TransactionResponse's corresponding Transaction asynchronously.
@@ -214,10 +224,14 @@ class TransactionResponse
214224
215225 /* *
216226 * Construct a TransactionRecordQuery for this TransactionResponse's corresponding Transaction.
227+ * When a non-null Client is provided and its failover flag is enabled, the query will target
228+ * the submitting node first, then other eligible nodes in deterministic order.
217229 *
230+ * @param client Optional pointer to the Client. When null or failover is disabled, the query is
231+ * pinned to the submitting node only.
218232 * @return The constructed TransactionRecordQuery.
219233 */
220- [[nodiscard]] TransactionRecordQuery getRecordQuery () const ;
234+ [[nodiscard]] TransactionRecordQuery getRecordQuery (const Client* client = nullptr ) const ;
221235
222236 /* *
223237 * Get a TransactionRecord for this TransactionResponse's corresponding Transaction asynchronously.
@@ -374,6 +388,20 @@ class TransactionResponse
374388 TransactionId mTransactionId ;
375389
376390private:
391+ /* *
392+ * Build a deduplicated, deterministically sorted failover node list starting with the submitting
393+ * node, using either the transaction's own node IDs or the client's network nodes as candidates.
394+ *
395+ * @param client The Client whose network is used when transaction node IDs are unavailable.
396+ * @return An ordered vector of AccountId values for query node targeting.
397+ */
398+ [[nodiscard]] std::vector<AccountId> buildFailoverNodeList (const Client& client) const ;
399+
400+ /* *
401+ * The node account IDs that were configured on the transaction during execution.
402+ */
403+ std::vector<AccountId> mTransactionNodeAccountIds ;
404+
377405 /* *
378406 * Did this TransactionResponse's corresponding Transaction have a successful pre-check?
379407 */
0 commit comments