mirror of
https://github.com/gosticks/iota.lib.java.git
synced 2026-10-04 21:46:59 +00:00
added replayTransfer
This commit is contained in:
@@ -285,7 +285,7 @@ public class IotaAPIProxy {
|
||||
* @param {array} trytes
|
||||
* @param {int} depth
|
||||
* @param {int} minWeightMagnitude
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public List<Transaction> sendTrytes(final String trytes, final int minWeightMagnitude) {
|
||||
|
||||
@@ -627,6 +627,30 @@ public class IotaAPIProxy {
|
||||
return null; //IotaAPIUtils.getBundle(transaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replays a transfer by doing Proof of Work again
|
||||
*
|
||||
* @method replayBundle
|
||||
* @param {string} tail
|
||||
* @param {int} depth
|
||||
* @param {int} minWeightMagnitude
|
||||
* @param {function} callback
|
||||
* @returns {object} analyzed Transaction objects
|
||||
**/
|
||||
public List<Transaction> replayTransfer(String transaction, int depth, int minWeightMagnitude) {
|
||||
|
||||
List<String> bundleTrytes = new ArrayList<>();
|
||||
|
||||
GetBundleResponse bundle = getBundle(transaction);
|
||||
|
||||
for (Transaction element : bundle.getTransactions()) {
|
||||
|
||||
bundleTrytes.add(IotaAPIUtils.transactionTrytes(element));
|
||||
}
|
||||
|
||||
return sendTrytes(bundleTrytes, minWeightMagnitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper function for getNodeInfo and getInclusionStates
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user