Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <chainey> MaterialDefender, yeah, looks like getdifficulty only partially implemented it
  2. <MaterialDefender> That's what I thought :/
  3. <chainey> small patch:
  4. <chainey> diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp
  5. <chainey> index 653933c..9849f75 100644
  6. <chainey> --- a/src/rpcblockchain.cpp
  7. <chainey> +++ b/src/rpcblockchain.cpp
  8. <chainey> @@ -109,11 +109,15 @@ Value getbestblockhash(const Array& params, bool fHelp)
  9. <chainey>
  10. <chainey> Value getdifficulty(const Array& params, bool fHelp)
  11. <chainey> {
  12. <chainey> - if (fHelp || params.size() != 0)
  13. <chainey> + if (fHelp)
  14. <chainey> throw runtime_error(
  15. <chainey> "getdifficulty\n"
  16. <chainey> "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.");
  17. <chainey>
  18. <chainey> + int miningAlgo = 0;
  19. <chainey> + if (params.size() == 1)
  20. <chainey> + miningAlgo = params[0].get_int();
  21. <chainey> +
  22. <chainey> return GetDifficulty(NULL, miningAlgo);
  23. <chainey> }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement