sc/deposit.js
function getSupernodeByDepositAddress(conn, depositAddress, cb){
    var conn = conn || db;
    if(!validationUtils.isNonemptyString(depositAddress))
        return cb("param depostiAddress is null or empty string");
    if(!validationUtils.isValidAddress(depositAddress))
        return cb("param depostiAddress is not a valid address");

    conn.query("SELECT address, safe_address FROM supernode WHERE deposit_address = ?", [depositAddress], 
        function(rows) {
            if (rows.length !== 1 )
                return cb("supernodeAddress is not found");
            cb(null, rows);
    });
}
function getSupernodeByDepositAddress(conn, depositAddress, cb){
    var conn = conn || db;
    if(!validationUtils.isNonemptyString(depositAddress))
        return cb("param depostiAddress is null or empty string");
    if(!validationUtils.isValidAddress(depositAddress))
        return cb("param depostiAddress is not a valid address");

    conn.query("SELECT address, safe_address FROM supernode WHERE deposit_address = ?", [depositAddress], 
        function(rows) {
            if (rows.length !== 1 )
                return cb("supernodeAddress is not found");
            cb(null, rows);
    });
}
function getSupernodeByDepositAddress ( conn , depositAddress , cb ) { var conn = conn || db ; if ( ! validationUtils . isNonemptyString ( depositAddress ) ) return cb ( "param depostiAddress is null or empty string" ) ; if ( ! validationUtils . isValidAddress ( depositAddress ) ) return cb ( "param depostiAddress is not a valid address" ) ; conn . query ( "SELECT address, safe_address FROM supernode WHERE deposit_address = ?" , [ depositAddress ] , function ( rows ) { if ( rows . length !== 1 ) return cb ( "supernodeAddress is not found" ) ; cb ( null , rows ) ; } ) ; }
Returns supernode address by deposit address.

@param	{obj}	    conn      if conn is null, use db query, otherwise use conn.
@param   {String}    depositAddress
@param   {function}	cb( err, supernodeAddress ) callback function
If depositAddress is invalid, then returns err "invalid address".
If can not find the address, then returns err "supernodeAddress not found".
Returns supernode address by deposit address .