You did the right thing, if attacked you would have been justified I feel by most states. Just make sure of where the bullet is going. Bullets that hit a skull at an angle can riccochet.
I was attacked by a pit bull. In the early 70's when I was an outside phone guy. I was wearing my knee high lineman's boots with a 2nd sole, the 1st thing we did was take them to the cobbler who put cut out cross saw blades between the soles so your feet could take longer times on a pole.
My first kick caught it right by the ear, spun him, I stomped him down and stood on his throat while doing an Irish Clog on his ribs.
The dogs owner was standing next to me and she had no idea what to do. You should have seen her eyes. They never turned it in.
When the dance was over I backed off ready to continue, he limped back into her house, whining. I also used a string of banned words that probably helped.
One of the neighbors saw this and came over to my truck, said we wish you would have killed it, it's bit 1/2 the kids in the neighborhood and killed several pets.
Grew up with neighboring farms and relatives that had large mean surly dogs. Had a little practice.
That same dog treed a phone guy up a pole and wouldn't let him down. He called the CO guy who brought a truck up, backed next to the pole and they sat up the road until the dog left.
A few days after I did the deed with the pit bull that tech and I were going to pull some cable into a building up the road. I saw the Pit in the yard, I stopped, the guy said what in the banned are you doing? I said watch this, he said don't open the truck door he'll eat you. I opened the door and charged him, he ran like the wind to his house. The other tech said what the heck? I said that is the one I trained the other day. He remembers my voice.
P.S. I'm a lifer phone guy, I have 10 or 20 good dog stories.