From fad522d140ffd9bb8370e70868a33d405e802eba Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 8 Jun 2023 12:25:03 -0500 Subject: [PATCH] dcrdtest: Support DCP0011 pow consensus vote. This updates the voting wallet to support the DCP0011 pow semantics on simnet. --- dcrdtest/go.mod | 2 +- dcrdtest/go.sum | 2 ++ dcrdtest/simnet_miner.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dcrdtest/go.mod b/dcrdtest/go.mod index a87ea8a..ffcb134 100644 --- a/dcrdtest/go.mod +++ b/dcrdtest/go.mod @@ -5,7 +5,7 @@ go 1.19 // The following require defines the version of dcrd that is built for tests // of this package and the minimum version used when this package is required // by a client module (unless overridden in the main module or workspace). -require github.com/decred/dcrd v1.2.1-0.20230430213532-8f3e24955554 +require github.com/decred/dcrd v1.2.1-0.20230607185305-0f38dbf2041b require ( github.com/decred/dcrd/blockchain/stake/v5 v5.0.0 diff --git a/dcrdtest/go.sum b/dcrdtest/go.sum index f36e279..849920a 100644 --- a/dcrdtest/go.sum +++ b/dcrdtest/go.sum @@ -10,6 +10,8 @@ github.com/decred/base58 v1.0.5 h1:hwcieUM3pfPnE/6p3J100zoRfGkQxBulZHo7GZfOqic= github.com/decred/base58 v1.0.5/go.mod h1:s/8lukEHFA6bUQQb/v3rjUySJ2hu+RioCzLukAVkrfw= github.com/decred/dcrd v1.2.1-0.20230430213532-8f3e24955554 h1:GrK0taW/raNPIv/Wd2RAnOimLBchwVXWfN4oD9seJws= github.com/decred/dcrd v1.2.1-0.20230430213532-8f3e24955554/go.mod h1:4s43hBjypXDSxT0/Wajs67Xqz3DD2Pz4mSrQPt5erYY= +github.com/decred/dcrd v1.2.1-0.20230607185305-0f38dbf2041b h1:oZhvbPG08p1+fhtHIJzC+SVREc0AqYPwv96lYxoQrMo= +github.com/decred/dcrd v1.2.1-0.20230607185305-0f38dbf2041b/go.mod h1:/vzUX0wDK2eJZMwuTAnADRo4XhQY9Z0q959OBMPUM0w= github.com/decred/dcrd/addrmgr/v2 v2.0.1 h1:o+AetOWZcSa2j2uVRf0gHvTSCmt4jMviKKpX/KgGQSw= github.com/decred/dcrd/addrmgr/v2 v2.0.1/go.mod h1:HcDrmMGqo2ilwjMi73YLwJQScv8djDPHgTV8kON8Wx4= github.com/decred/dcrd/bech32 v1.1.3 h1:EeipVC1dO4zkjTjyqvrWt6JT2Ajr1EHZt+BAmWN864s= diff --git a/dcrdtest/simnet_miner.go b/dcrdtest/simnet_miner.go index 0997df9..6574638 100644 --- a/dcrdtest/simnet_miner.go +++ b/dcrdtest/simnet_miner.go @@ -46,8 +46,8 @@ func solveBlock(header *wire.BlockHeader) bool { return default: hdr.Nonce = i - hash := hdr.BlockHash() - if standalone.HashToBig(&hash).Cmp( + powHash := hdr.PowHashV2() + if standalone.HashToBig(&powHash).Cmp( targetDifficulty) <= 0 { results <- sbResult{true, i}