mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Prepare access to untrim headers
This commit is contained in:
parent
a4d7ac7bbe
commit
31835f2a86
4 changed files with 13 additions and 0 deletions
|
|
@ -5,6 +5,11 @@
|
|||
|
||||
#include <chain.h>
|
||||
#include <util/time.h>
|
||||
#include <validation.h>
|
||||
#include <node/context.h>
|
||||
|
||||
|
||||
node::NodeContext *CBlockIndex::m_pcontext;
|
||||
|
||||
std::string CBlockFileInfo::ToString() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
namespace node {
|
||||
struct NodeContext;
|
||||
}
|
||||
/**
|
||||
* Maximum amount of time that a block timestamp is allowed to exceed the
|
||||
* current network-adjusted time before the block will be accepted.
|
||||
|
|
@ -218,7 +221,10 @@ protected:
|
|||
|
||||
friend class CBlockTreeDB;
|
||||
|
||||
static node::NodeContext *m_pcontext;
|
||||
|
||||
public:
|
||||
static void SetNodeContext(node::NodeContext *context) {m_pcontext = context;};
|
||||
|
||||
// Irrevocably remove blocksigning and dynafed-related stuff from this
|
||||
// in-memory copy of the block header.
|
||||
|
|
|
|||
|
|
@ -1243,6 +1243,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
const ArgsManager& args = *Assert(node.args);
|
||||
const CChainParams& chainparams = Params();
|
||||
|
||||
CBlockIndex::SetNodeContext(&node);
|
||||
auto opt_max_upload = ParseByteUnits(args.GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET), ByteUnit::M);
|
||||
if (!opt_max_upload) {
|
||||
return InitError(strprintf(_("Unable to parse -maxuploadtarget: '%s'"), args.GetArg("-maxuploadtarget", "")));
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ class BlockManager
|
|||
{
|
||||
friend CChainState;
|
||||
friend ChainstateManager;
|
||||
friend CBlockIndex;
|
||||
|
||||
private:
|
||||
void FlushBlockFile(bool fFinalize = false, bool finalize_undo = false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue