mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-09 19:27:54 +00:00
Allow users to delete trade-bot entries in any state if corresponding AT does not exist
This commit is contained in:
parent
0306ecb03d
commit
018c3cdcd4
@ -23,7 +23,7 @@ public interface AcctTradeBot {
|
|||||||
public ResponseResult startResponse(Repository repository, ATData atData, ACCT acct,
|
public ResponseResult startResponse(Repository repository, ATData atData, ACCT acct,
|
||||||
CrossChainTradeData crossChainTradeData, String foreignKey, String receivingAddress) throws DataException;
|
CrossChainTradeData crossChainTradeData, String foreignKey, String receivingAddress) throws DataException;
|
||||||
|
|
||||||
public boolean canDelete(Repository repository, TradeBotData tradeBotData);
|
public boolean canDelete(Repository repository, TradeBotData tradeBotData) throws DataException;
|
||||||
|
|
||||||
public void progress(Repository repository, TradeBotData tradeBotData) throws DataException, ForeignBlockchainException;
|
public void progress(Repository repository, TradeBotData tradeBotData) throws DataException, ForeignBlockchainException;
|
||||||
|
|
||||||
|
@ -345,11 +345,15 @@ public class BitcoinACCTv1TradeBot implements AcctTradeBot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDelete(Repository repository, TradeBotData tradeBotData) {
|
public boolean canDelete(Repository repository, TradeBotData tradeBotData) throws DataException {
|
||||||
State tradeBotState = State.valueOf(tradeBotData.getStateValue());
|
State tradeBotState = State.valueOf(tradeBotData.getStateValue());
|
||||||
if (tradeBotState == null)
|
if (tradeBotState == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// If the AT doesn't exist then we might as well let the user tidy up
|
||||||
|
if (!repository.getATRepository().exists(tradeBotData.getAtAddress()))
|
||||||
|
return true;
|
||||||
|
|
||||||
switch (tradeBotState) {
|
switch (tradeBotState) {
|
||||||
case BOB_WAITING_FOR_AT_CONFIRM:
|
case BOB_WAITING_FOR_AT_CONFIRM:
|
||||||
case ALICE_DONE:
|
case ALICE_DONE:
|
||||||
|
@ -343,11 +343,15 @@ public class LitecoinACCTv1TradeBot implements AcctTradeBot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDelete(Repository repository, TradeBotData tradeBotData) {
|
public boolean canDelete(Repository repository, TradeBotData tradeBotData) throws DataException {
|
||||||
State tradeBotState = State.valueOf(tradeBotData.getStateValue());
|
State tradeBotState = State.valueOf(tradeBotData.getStateValue());
|
||||||
if (tradeBotState == null)
|
if (tradeBotState == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// If the AT doesn't exist then we might as well let the user tidy up
|
||||||
|
if (!repository.getATRepository().exists(tradeBotData.getAtAddress()))
|
||||||
|
return true;
|
||||||
|
|
||||||
switch (tradeBotState) {
|
switch (tradeBotState) {
|
||||||
case BOB_WAITING_FOR_AT_CONFIRM:
|
case BOB_WAITING_FOR_AT_CONFIRM:
|
||||||
case ALICE_DONE:
|
case ALICE_DONE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user