github.com/BlockABC/godash@v0.0.0-20191112120524-f4aa3a32c566/addrmgr/internal_test.go (about)

     1  // Copyright (c) 2013-2015 The btcsuite developers
     2  // Copyright (c) 2016 The Dash developers
     3  // Use of this source code is governed by an ISC
     4  // license that can be found in the LICENSE file.
     5  
     6  package addrmgr
     7  
     8  import (
     9  	"time"
    10  
    11  	"github.com/BlockABC/godash/wire"
    12  )
    13  
    14  func TstKnownAddressIsBad(ka *KnownAddress) bool {
    15  	return ka.isBad()
    16  }
    17  
    18  func TstKnownAddressChance(ka *KnownAddress) float64 {
    19  	return ka.chance()
    20  }
    21  
    22  func TstNewKnownAddress(na *wire.NetAddress, attempts int,
    23  	lastattempt, lastsuccess time.Time, tried bool, refs int) *KnownAddress {
    24  	return &KnownAddress{na: na, attempts: attempts, lastattempt: lastattempt,
    25  		lastsuccess: lastsuccess, tried: tried, refs: refs}
    26  }