WIP: trade-bot: allow trade-bot entries to be deleted if in BOB_WAITING_FOR_AT_CONFIRM state. Also, return false (instead of throwing internal error) if trade-bot entry does not exist

This commit is contained in:
catbref 2020-07-29 18:13:27 +01:00
parent d85b746021
commit 83955acd22

View File

@ -1083,8 +1083,11 @@ public class CrossChainResource {
try (final Repository repository = RepositoryManager.getRepository()) {
TradeBotData tradeBotData = repository.getCrossChainRepository().getTradeBotData(tradePrivateKey);
if (tradeBotData == null)
return "false";
switch (tradeBotData.getState()) {
case BOB_WAITING_FOR_AT_CONFIRM:
case ALICE_DONE:
case BOB_DONE:
case ALICE_REFUNDED: