use only txids for unlocking tips

This commit is contained in:
Akinwale Ariwodola 2020-06-05 07:17:56 +01:00
parent 5f1775d478
commit cc1ddfa16e
2 changed files with 3 additions and 6 deletions

View file

@ -29,7 +29,6 @@ public class UnlockTipsTask extends AsyncTask<Void, Void, Boolean> {
public Boolean doInBackground(Void... params) { public Boolean doInBackground(Void... params) {
List<String> txids = new ArrayList<>(); List<String> txids = new ArrayList<>();
List<String> claimIds = new ArrayList<>();
try { try {
Map<String, Object> options = new HashMap<>(); Map<String, Object> options = new HashMap<>();
@ -42,18 +41,15 @@ public class UnlockTipsTask extends AsyncTask<Void, Void, Boolean> {
for (int i = 0; i < items.length(); i++) { for (int i = 0; i < items.length(); i++) {
JSONObject item = items.getJSONObject(i); JSONObject item = items.getJSONObject(i);
String txid = Helper.getJSONString("txid", null, item); String txid = Helper.getJSONString("txid", null, item);
String claimId = Helper.getJSONString("claim_id", null, item); if (!Helper.isNullOrEmpty(txid)) {
if (!Helper.isNullOrEmpty(txid) && !Helper.isNullOrEmpty(claimId)) {
txids.add(txid); txids.add(txid);
claimIds.add(claimId);
} }
} }
} }
if (txids.size() > 0 && txids.size() == claimIds.size()) { if (txids.size() > 0) {
options = new HashMap<>(); options = new HashMap<>();
options.put("txid", txids); options.put("txid", txids);
options.put("claim_id", claimIds);
options.put("blocking", true); options.put("blocking", true);
Lbry.genericApiCall(Lbry.METHOD_TXO_SPEND, options); Lbry.genericApiCall(Lbry.METHOD_TXO_SPEND, options);
} }

View file

@ -1108,6 +1108,7 @@ public class PublishFormFragment extends BaseFragment implements
// Run the logPublish task // Run the logPublish task
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
claimResult.setSigningChannel(claim.getSigningChannel());
LogPublishTask logPublish = new LogPublishTask(claimResult); LogPublishTask logPublish = new LogPublishTask(claimResult);
logPublish.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); logPublish.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }