rpctest: Update for removal of wire.BlockVersion

This adds constant for the block version to the rpctest package since it
is no longer available via the wire package due to the new BIP0009 code.
This commit is contained in:
Dave Collins 2016-08-28 17:52:27 -05:00
parent c440584efc
commit 25520b40ad
No known key found for this signature in database
GPG key ID: B8904D9D9C93D1F2
2 changed files with 7 additions and 3 deletions

View file

@ -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()

View file

@ -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