Adding functions to get block contents for debugging.
This commit is contained in:
parent
71723d28af
commit
fbfedd47bc
2 changed files with 19 additions and 0 deletions
|
@ -2704,6 +2704,23 @@ bool rai::ledger::block_exists (rai::block_hash const & hash_a)
|
|||
return result;
|
||||
}
|
||||
|
||||
std::string rai::ledger::block_text (char const * hash_a)
|
||||
{
|
||||
return block_text (rai::block_hash (hash_a));
|
||||
}
|
||||
|
||||
std::string rai::ledger::block_text (rai::block_hash const & hash_a)
|
||||
{
|
||||
std::string result;
|
||||
rai::transaction transaction (store.environment, nullptr, false);
|
||||
auto block (store.block_get (transaction, hash_a));
|
||||
if (block != nullptr)
|
||||
{
|
||||
block->serialize_json (result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Vote weight of an account
|
||||
rai::uint128_t rai::ledger::weight (MDB_txn * transaction_a, rai::account const & account_a)
|
||||
{
|
||||
|
|
|
@ -463,6 +463,8 @@ public:
|
|||
rai::block_hash representative (MDB_txn *, rai::block_hash const &);
|
||||
rai::block_hash representative_calculated (MDB_txn *, rai::block_hash const &);
|
||||
bool block_exists (rai::block_hash const &);
|
||||
std::string block_text (char const *);
|
||||
std::string block_text (rai::block_hash const &);
|
||||
rai::uint128_t supply (MDB_txn *);
|
||||
rai::process_return process (MDB_txn *, rai::block const &);
|
||||
bool rollback (MDB_txn *, rai::block_hash const &);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue