func (db *DB) addPeerConnToDB(address [4]byte, peerConn *connInfo) {

	// Get the head of the binaryTree
	var head = db.addressTreeHead
	//Get the address so we know the path in the binaryTree
	var bitAddress = byteToBit(address)

	for i := 0; i < len(bitAddress); i++ {
		if bitAddress[i] {
			head = head.rightChild()
		} else {
			head = head.leftChild()
		}
	}

	addressInfo := (head.getData().(*addressInfo))

	//Add entry to the tree
	addressInfo.peerConn = peerConn
}
//loads a peer connection into the DB, replacing the existing one, if it exists
loads a peer connection into the DB, replacing the existing one, if it exists
// loads a peer connection into the DB replacing the existing one if it exists
func (db *DB) addPeerConnToDB(address [4]byte, peerConn *connInfo) {
	var head = db.addressTreeHead
	var bitAddress = byteToBit(address)
	for i := 0; i < len(bitAddress); i++ {
		if bitAddress[i] {
			head = head.rightChild()
		} else {
			head = head.leftChild()
		}
	}
	addressInfo := (head.getData().(*addressInfo))
	addressInfo.peerConn = peerConn
}
func ( db * DB ) addPeerConnToDB ( address [ 4 ] byte , peerConn * connInfo ) { var head = db . addressTreeHead var bitAddress = byteToBit ( address ) for i := 0 ; i < len ( bitAddress ) ; i ++ { if bitAddress [ i ] { head = head . rightChild ( ) } else { head = head . leftChild ( ) } } addressInfo := ( head . getData ( ) . ( * addressInfo ) ) addressInfo . peerConn = peerConn }
loads a peer connection into the DB, replacing the existing one, if it exists
loads a peer connection into the DB replacing the existing one if it exists
// Get the head of the binaryTree //Get the address so we know the path in the binaryTree //Add entry to the tree