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;
}
transactions that cancel the same order. After one of them is confirmed another transaction will be removed from unconfirmed transactions list. This makes it very cheap to DoS nodes - just send 1000000 transactions that cancel the same order. If we included all such transactions into blocks then DoSing would be very expensive.