How do I call getblocktemplate from the bitcoinlib package for C#?

This call does not work

ICoinService CoinService = new BitcoinService(useTestnet: true);
var blockTemplate = CoinService.GetBlockTemplate();
var blockTemplate = CoinService.GetBlockTemplate( new { rules=new List<string> { "segwit" } });

This function call requires you to specify rules for the block you want to create and in newer Bitcoin Core version, you can only create blocks following the segwit softfork rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.