PR #112 added a second parameter, namely String reference, to GetTransactionsToApproveResponse.

This parameter can also be set in sendTrytes. The Javadoc there says

Hash of transaction to start random-walk from, used to make sure the tips returned reference a given transaction in their past.

When and why would I set this parameter, instead of leaving it null?


/**
 * Facade method: Gets transactions to approve, attaches to Tangle, broadcasts and stores.
 *
 * @param trytes             The trytes.
 * @param depth              The depth.
 * @param minWeightMagnitude The minimum weight magnitude.
 * @param reference          Hash of transaction to start random-walk from, used to make sure the tips returned reference a given transaction in their past.
 * @return Transactions objects.
 * @throws ArgumentException is thrown when invalid trytes is provided.
 */
public List<Transaction> sendTrytes(final String[] trytes, final int depth, final int minWeightMagnitude, final String reference) throws ArgumentException;
  • 1
    I can think of two reasons: 1) when you want to promote another transaction with your transaction/bundle. 2) when you try to spend a balance you received but which was not confirmed, to make sure that other transaction confirms too before/when your transaction confirms. – mihi Oct 11 at 18:29
  • Thx. To 1: What does 'promote' mean in this context. To 2: Okay, understood. This translates to payments within sub-tangles. – mike Oct 12 at 9:22
  • 1
    Promote = reference an old transaction by a more recent one to increase the chance of it (or more precisely, both of them) getting confirmed by the coordinator. – mihi Oct 12 at 19:10

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.