Closed raphjaph closed 3 years ago
We recently added an Acceptor
interface that you can implement in order to verify the commands. We call the Accept()
method on this interface after a block has been determined to be safe. See the code here. In your case it should be fine to check the commands at the beginning of the function like you suggested.
Great, thanks for the prompt answer! Seems like I still had the repo state from last month. Will have a look at all the refactoring.
I'm not quite sure if this is the correct place to ask but I was wondering where in consensus.go would be the best place to verify the commands in a block. As I understand it, the OnReceiveProposal() function just checks the block is placed correctly in the chain but it doesn't look inside the blocks to check the semantics of the commands. My idea was to just place the check at the beginning of that function (as seen below). Is this the right way/place to perform such checks?
Thanks!