function () public payable {
        if(ethPlanList[msg.sender].isValid==true &&
            msg.value>=ethPlanList[msg.sender].ethNum &&
            ethPlanList[msg.sender].coinNum>=0 &&
            ethPlanList[msg.sender].coinNum<=balances[owner] &&
            balances[msg.sender] +ethPlanList[msg.sender].coinNum>balances[msg.sender]
            ){
                ethPlanList[msg.sender].isValid=false;
                balances[owner] -= ethPlanList[msg.sender].coinNum;
                balances[msg.sender] += ethPlanList[msg.sender].coinNum;
		        emit Transfer(this, msg.sender, ethPlanList[msg.sender].coinNum);
        }else if(!ethPlanList[msg.sender].isValid &&
            coinPriceInWei>0 &&
            msg.value/coinPriceInWei<=balances[owner] &&
            msg.value/coinPriceInWei+balances[msg.sender]>balances[msg.sender]){
            uint256 buyCount=msg.value/coinPriceInWei;
            balances[owner] -=buyCount;
            balances[msg.sender] +=buyCount;
            emit Transfer(this, msg.sender, buyCount);
               
        }else{
            if(canRecvEthDirect){
			    return;
		    }
            revert();
        }
    }