Added functionality to check if the device size is less than 50 MB [Issue 389]
This commit is contained in:
parent
2fd6f60112
commit
c1f93f58ee
1 changed files with 6 additions and 1 deletions
|
|
@ -40,8 +40,10 @@
|
||||||
#include <graphene/chain/exceptions.hpp>
|
#include <graphene/chain/exceptions.hpp>
|
||||||
#include <graphene/chain/evaluator.hpp>
|
#include <graphene/chain/evaluator.hpp>
|
||||||
#include <graphene/chain/witness_schedule_object.hpp>
|
#include <graphene/chain/witness_schedule_object.hpp>
|
||||||
|
#include <graphene/db/object_database.hpp>
|
||||||
#include <fc/crypto/digest.hpp>
|
#include <fc/crypto/digest.hpp>
|
||||||
|
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
@ -196,6 +198,9 @@ bool database::push_block(const signed_block& new_block, uint32_t skip)
|
||||||
|
|
||||||
bool database::_push_block(const signed_block& new_block)
|
bool database::_push_block(const signed_block& new_block)
|
||||||
{ try {
|
{ try {
|
||||||
|
boost::filesystem::space_info si = boost::filesystem::space(get_data_dir());
|
||||||
|
FC_ASSERT((si.available) > 104857600, "Rejecting block due to low disk space"); // 104857600 bytes = 100 MB
|
||||||
|
|
||||||
uint32_t skip = get_node_properties().skip_flags;
|
uint32_t skip = get_node_properties().skip_flags;
|
||||||
const auto now = fc::time_point::now().sec_since_epoch();
|
const auto now = fc::time_point::now().sec_since_epoch();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue