Btw, what do u think of the approach when dumb actions, like an attempt to cancel a non-existent bid order, r processed without sanity checks? The fee is paid, transaction is added to the block but the state is not changed.
I don't like the idea, at least in this case it is very simple to enforce such a check, in Transaction.Type.ColoredCoins.ASK_ORDER_CANCELLATION just add:
boolean validateAttachment(Transaction transaction) {
Attachment.ColoredCoinsAskOrderCancellation attachment = (Attachment.ColoredCoinsAskOrderCancellation)transaction.attachment;
if (Order.Ask.getAskOrder(attachment.getOrderId()) == null) {
return false;
}
return Genesis.CREATOR_ID.equals(transaction.recipientId) && transaction.amount == 0;
}