Giter Club home page Giter Club logo

Comments (4)

Sword-Smith avatar Sword-Smith commented on July 23, 2024 1

Hi there,
Since Bitcoin 0.13.1 (segwit), the getblocktemplate() method no longer returns anything.

I think this is due to the fact that you now need to specify a rule when calling getblocktemplate. For example, if you call:

bitcoin-cli getblocktemplate
You get this error:

error code: -8
error message:
Support for 'segwit' rule requires explicit client support

To get it working, you have to pass a rule like this as an extra argument, like so:

bitcoin-cli getblocktemplate '{"rules":["segwit"]}'

I'm trying with this:
CoinService.GetBlockTemplate("'{\"rules\":[\"segwit\"]}'")
but the result is:
"{\"result\":null,\"error\":{\"code\":-1,\"message\":\"JSON value is not an object as expected\"},\"id\":1}\n"
Is there any way to pass this argument to the CoinService.GetBlockTemplate() method to get it working again?

@idt-byte

Against my 0.19.1 Bitcoin Core node, this call works:

var blockTemplate = CoinService.GetBlockTemplate( new { rules=new List<string> { "segwit" } });

So by supplying the parameters as an anonymous type you should be able to get the call to work. If you think the interface should work differentely, let me know.

from bitcoinlib.

moodmosaic avatar moodmosaic commented on July 23, 2024

@idt-byte, thank you for reporting this πŸ‘ I apologize for the delay, I hope @Sword-Smith can look into this (as per #116). Let’s give @Sword-Smith 3 days to respond.

from bitcoinlib.

Sword-Smith avatar Sword-Smith commented on July 23, 2024

Looking into it

from bitcoinlib.

Sword-Smith avatar Sword-Smith commented on July 23, 2024

Closing this as it works and the interface in my opinion is OK

from bitcoinlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.