You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

blockchain.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 2017 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_RPC_BLOCKCHAIN_H
  5. #define STARWELS_RPC_BLOCKCHAIN_H
  6. class CBlock;
  7. class CBlockIndex;
  8. class UniValue;
  9. /**
  10. * Get the difficulty of the net wrt to the given block index, or the chain tip if
  11. * not provided.
  12. *
  13. * @return A floating point number that is a multiple of the main net minimum
  14. * difficulty (4295032833 hashes).
  15. */
  16. double GetDifficulty(const CBlockIndex* blockindex = nullptr);
  17. /** Callback for when block tip changed. */
  18. void RPCNotifyBlockChange(bool ibd, const CBlockIndex *);
  19. /** Block description to JSON */
  20. UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false);
  21. /** Mempool information to JSON */
  22. UniValue mempoolInfoToJSON();
  23. /** Mempool to JSON */
  24. UniValue mempoolToJSON(bool fVerbose = false);
  25. /** Block header to JSON */
  26. UniValue blockheaderToJSON(const CBlockIndex* blockindex);
  27. #endif