diff --git a/rpctest/rpc_harness.go b/rpctest/rpc_harness.go index 26074da2..3a97b6c5 100644 --- a/rpctest/rpc_harness.go +++ b/rpctest/rpc_harness.go @@ -30,6 +30,10 @@ const ( maxPeerPort = 35000 minRPCPort = maxPeerPort maxRPCPort = 60000 + + // BlockVersion is the default block version used when generating + // blocks. + BlockVersion = 4 ) var ( @@ -377,7 +381,7 @@ func (h *Harness) GenerateAndSubmitBlock(txns []*btcutil.Tx, blockVersion int32, defer h.Unlock() if blockVersion == -1 { - blockVersion = wire.BlockVersion + blockVersion = BlockVersion } prevBlockHash, prevBlockHeight, err := h.Node.GetBestBlock() diff --git a/rpctest/rpc_harness_test.go b/rpctest/rpc_harness_test.go index b1048b91..c3fc18b4 100644 --- a/rpctest/rpc_harness_test.go +++ b/rpctest/rpc_harness_test.go @@ -363,9 +363,9 @@ func testGenerateAndSubmitBlock(r *Harness, t *testing.T) { "expected %v, got %v", numTxns+1, numBlocksTxns) } blockVersion := block.MsgBlock().Header.Version - if blockVersion != wire.BlockVersion { + if blockVersion != BlockVersion { t.Fatalf("block version is not default: expected %v, got %v", - wire.BlockVersion, blockVersion) + BlockVersion, blockVersion) } // Next generate a block with a "non-standard" block version along with