use of jota.dto.response.GetAttachToTangleResponse in project isf-jclient by mikrohash.
the class IotaAPI method sendSpam.
public void sendSpam() throws ArgumentException {
ArrayList<Transfer> transfers = new ArrayList<Transfer>();
String message = UploadDataManager.getNextData();
transfers.add(new Transfer(AddressManager.getSpamAddress(), 0, message, SpamThread.getTag()));
List<Input> inputs = new ArrayList<Input>();
List<String> trytes = prepareTransfers("", SECURITY, transfers, null, inputs, false);
GetTransactionsToApproveResponse txs = TipPool.getTransactionsToApprove();
while (txs == null) txs = NodeManager.getTransactionsToApprove(NodeManager.getRotatedAPI());
final GetAttachToTangleResponse res = attachToTangle(txs.getTrunkTransaction(), txs.getBranchTransaction(), MIN_WEIGHT_MAGNITUDE, trytes.toArray(new String[trytes.size()]));
TxBroadcaster.queueTrytes(res);
}
use of jota.dto.response.GetAttachToTangleResponse in project isf-jclient by mikrohash.
the class IotaAPI method createSpam.
public void createSpam() throws ArgumentException {
ArrayList<Transfer> transfers = new ArrayList<Transfer>();
String message = UploadDataManager.getNextData();
transfers.add(new Transfer(AddressManager.getSpamAddress(), 0, message, SpamThread.getTag()));
List<Input> inputs = new ArrayList<Input>();
List<String> trytes = prepareTransfers("", SECURITY, transfers, null, inputs, false);
String[] tips = TipPool.getTransactionsToApprove();
while (tips == null) {
GetTransactionsToApproveResponse gttar = NodeManager.getTransactionsToApprove(NodeManager.getRotatedAPI());
tips = new String[] { gttar.getTrunkTransaction(), gttar.getBranchTransaction() };
}
final GetAttachToTangleResponse res = attachToTangle(tips[0], tips[1], MIN_WEIGHT_MAGNITUDE, trytes.toArray(new String[trytes.size()]));
TxBroadcaster.queueTrytes(res);
}
Aggregations