From f53e0b5dc0de444f88dbaffe3e25348903bd35e6 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:08:09 +0200 Subject: [PATCH] Only allow v2 shares to be mined on stratum server --- p2pool/stratum/server.go | 4 ++++ p2pool/stratum/template.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/p2pool/stratum/server.go b/p2pool/stratum/server.go index dbc436c..02afd47 100644 --- a/p2pool/stratum/server.go +++ b/p2pool/stratum/server.go @@ -190,6 +190,10 @@ func (s *Server) fillNewTemplateData(currentDifficulty types.Difficulty) error { if s.newTemplateData.ShareVersion < sidechain.ShareVersion_V2 { return errors.New("unsupported sidechain version") } + // no merge mining nor merkle proof support yet + if s.newTemplateData.ShareVersion > sidechain.ShareVersion_V2 { + return errors.New("unsupported sidechain version") + } if s.tip != nil { s.newTemplateData.PreviousTemplateId = s.tip.SideTemplateId(s.sidechain.Consensus()) diff --git a/p2pool/stratum/template.go b/p2pool/stratum/template.go index 5cd2733..36c8502 100644 --- a/p2pool/stratum/template.go +++ b/p2pool/stratum/template.go @@ -216,7 +216,7 @@ func (tpl *Template) HashingBlob(hasher *sha3.HasherState, preAllocatedBuffer [] } func TemplateFromPoolBlock(b *sidechain.PoolBlock) (tpl *Template, err error) { - if b.ShareVersion() != sidechain.ShareVersion_V2 { + if b.ShareVersion() < sidechain.ShareVersion_V1 || b.ShareVersion() > sidechain.ShareVersion_V2 { return nil, errors.New("unsupported share version") } totalLen := b.BufferLength()