use current header version in new slates (#804)

* use current header version

* flip header version check and bump min node version

(cherry picked from commit 991ba1a1f7)
This commit is contained in:
wiesche
2026-10-11 00:45:56 +03:00
committed by ardocrat
parent ac4d18d6bd
commit bded95e282
6 changed files with 32 additions and 25 deletions
+3 -7
View File
@@ -66,22 +66,18 @@ lazy_static! {
fn check_middleware(
name: ForeignCheckMiddlewareFn,
node_version_info: Option<NodeVersionInfo>,
_node_version_info: Option<NodeVersionInfo>,
slate: Option<&Slate>,
) -> Result<(), Error> {
match name {
// allow coinbases to be built regardless
ForeignCheckMiddlewareFn::BuildCoinbase => Ok(()),
_ => {
let mut bhv = 3;
if let Some(n) = node_version_info {
bhv = n.block_header_version;
}
if let Some(s) = slate {
if bhv > 4 && s.version_info.block_header_version < GRIN_BLOCK_HEADER_VERSION {
if s.version_info.block_header_version > GRIN_BLOCK_HEADER_VERSION {
Err(Error::Compatibility(
"Incoming Slate is not compatible with this wallet. \
Please upgrade the node or use a different one."
Please upgrade the wallet."
.into(),
))?;
}