Code snippet: How to manually validate a Bitcoin block?