wallet/light.js
function addSharedAddressesOfWallet(arrAddressList, handleAddedSharedAddresses){
	if (!arrAddressList || arrAddressList.length === 0 )
		return handleAddedSharedAddresses([]);
	var strAddressList = arrAddressList.map(db.escape).join(', ');
	db.query("SELECT DISTINCT shared_address FROM shared_address_signing_paths WHERE address IN("+strAddressList+")", function(rows){
		if (rows.length === 0)
			return handleAddedSharedAddresses(arrAddressList);
		var arrSharedAddresses = rows.map(function(row){ return row.shared_address; });
		var arrNewMemberAddresses = _.difference(arrSharedAddresses, arrAddressList);
		if (arrNewMemberAddresses.length === 0)
			return handleAddedSharedAddresses(arrAddressList);
		addSharedAddressesOfWallet(arrAddressList.concat(arrNewMemberAddresses), handleAddedSharedAddresses);
	});
}
function addSharedAddressesOfWallet(arrAddressList, handleAddedSharedAddresses){
	if (!arrAddressList || arrAddressList.length === 0 )
		return handleAddedSharedAddresses([]);
	var strAddressList = arrAddressList.map(db.escape).join(', ');
	db.query("SELECT DISTINCT shared_address FROM shared_address_signing_paths WHERE address IN("+strAddressList+")", function(rows){
		if (rows.length === 0)
			return handleAddedSharedAddresses(arrAddressList);
		var arrSharedAddresses = rows.map(function(row){ return row.shared_address; });
		var arrNewMemberAddresses = _.difference(arrSharedAddresses, arrAddressList);
		if (arrNewMemberAddresses.length === 0)
			return handleAddedSharedAddresses(arrAddressList);
		addSharedAddressesOfWallet(arrAddressList.concat(arrNewMemberAddresses), handleAddedSharedAddresses);
	});
}
function addSharedAddressesOfWallet ( arrAddressList , handleAddedSharedAddresses ) { if ( ! arrAddressList || arrAddressList . length === 0 ) return handleAddedSharedAddresses ( [ ] ) ; var strAddressList = arrAddressList . map ( db . escape ) . join ( ', ' ) ; db . query ( "SELECT DISTINCT shared_address FROM shared_address_signing_paths WHERE address IN(" + strAddressList + ")" , function ( rows ) { if ( rows . length === 0 ) return handleAddedSharedAddresses ( arrAddressList ) ; var arrSharedAddresses = rows . map ( function ( row ) { return row . shared_address ; } ) ; var arrNewMemberAddresses = _ . difference ( arrSharedAddresses , arrAddressList ) ; if ( arrNewMemberAddresses . length === 0 ) return handleAddedSharedAddresses ( arrAddressList ) ; addSharedAddressesOfWallet ( arrAddressList . concat ( arrNewMemberAddresses ) , handleAddedSharedAddresses ) ; } ) ; }
Victor ShareAddress Add
Victor ShareAddress Add