dcrd/peer/export_test.go
Dave Collins 756eff2fee peer: Refactor peer code into its own package.
Contains the following upstream commits:

- 00bddf7540
- 250228c32f
- f1bd2f8d6e
- cbbe3a8bbe
- aa03d68e1e

In addition to the normal required changes for syncing, the following
changes have been made in order to facilitate integration of the new
package into Decred:

- Removed check in PushRejectMsg against protocol version since all
  peers since the initial version support it
- Fixed leaked timer in `syncMiningStateAfterSync` function
- Add the Decred-specific OnGetMiningState and OnMiningState handlers to
  the new peer package
- Add handler for the new mining state messages to the 'serverPeer' type
  and register them
- Use the new constant for wire.InitialProtocolVersion in the reject
  message instead of hard coded number
- Remove logic specific to the regression network since Decred does not
  have it
2016-05-20 13:58:23 -05:00

20 lines
664 B
Go

// Copyright (c) 2015 The btcsuite developers
// Copyright (c) 2016 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
/*
This test file is part of the peer package rather than than the peer_test
package so it can bridge access to the internals to properly test cases which
are either not possible or can't reliably be tested via the public interface.
The functions are only exported while the tests are being run.
*/
package peer
// TstAllowSelfConns allows the test package to allow self connections by
// disabling the detection logic.
func TstAllowSelfConns() {
allowSelfConns = true
}