Too many electrical cables
I recently replaced the ceiling fan is my very old house. The original fan worked properly, had separate fan and light switches on the fixture, and was controlled by the light switch on the wall which also operated properly. When I dismantled the fan, I found two main electric cables coming from the ceiling instead of only one. I assumed the two black wires were connected to the fan's black wire and the two white wires were connected to the fan's white wire so quickly disconnected it all without noticing closely.
When I installed the new fan, I put the two black wires from the ceiling with the black and blue fan wires and put the two white wires with the fan's white wire. When I turned the power back on, the fan now turned on when the light switch (on the wall) was in the off position. The fan operated properly until I turned it off and this flipped the breaker.
Can anyone please advise on what I do with that extra main cable coming from the ceiling?
GM