[#PermittedDifficultyTransition]
= PermittedDifficultyTransition
:mrdocs:

Return false if the proof&hyphen;of&hyphen;work requirement specified by new&lowbar;nbits at a given height is not possible, given the proof&hyphen;of&hyphen;work on the prior block as specified by old&lowbar;nbits&period;

== Synopsis

Declared in `&lt;pow&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
PermittedDifficultyTransition(
    xref:Consensus/Params.adoc[Consensus::Params] const& params,
    int64&lowbar;t height,
    uint32&lowbar;t old&lowbar;nbits,
    uint32&lowbar;t new&lowbar;nbits);
----

== Description

This function only checks that the new value is within a factor of 4 of the old value for blocks at the difficulty adjustment interval, and otherwise requires the values to be the same&period;

Always returns true on networks where min difficulty blocks are allowed, such as regtest&sol;testnet&period;

== Return Value

true if the transition from old&lowbar;nbits to new&lowbar;nbits is permitted&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *params*
| The consensus parameters for the active chain&period;
| *height*
| The height of the block whose target is being validated&period;
| *old&lowbar;nbits*
| The proof&hyphen;of&hyphen;work target of the prior block, in compact form&period;
| *new&lowbar;nbits*
| The proposed proof&hyphen;of&hyphen;work target, in compact form&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
