private synchronized void createFriendLink( final Map<KeyRegistrationRecord, Set<KeyRegistrationRecord>> topology, final KeyRegistrationRecord a, final KeyRegistrationRecord b, boolean writeToDB ) {
		Set<KeyRegistrationRecord> a_peers = topology.get(a);
		Set<KeyRegistrationRecord> b_peers = topology.get(b);
		
		a_peers.add(b);
		b_peers.add(a);
		
		if( writeToDB ) {
			/**
			 * Might these db_ids no longer be valid by the time we actually get around to writing this update? 
			 * Sure -- but that's okay, the referential integrity checks will cause a rollback, we'll print an 
			 * error message that can be ignored, and the next time this client refreshes, it will get the correct entries. 
			 */
			try {
				mLazyDBQueue.put(new Runnable(){
					public void run() {
						(new SQLStatementProcessor<Void>("INSERT INTO topology (A_id, B_id) VALUES (?, ?)") { 
							Void process( PreparedStatement s ) throws SQLException {
								if( a.getID() < b.getID() ) {
									s.setLong(1, a.getID());
									s.setLong(2, b.getID());
								} else { 
									s.setLong(1, b.getID());
									s.setLong(2, a.getID());
								}
								s.executeUpdate();
								return null;
							}
						}).doit();
					}
				});
			} catch (InterruptedException e) {
				e.printStackTrace();
				logger.warning(e.toString());
			}
		}
	}