So I have been thinking about the Lightning Network for a bit as far as running a node goes.
From my limited understanding of it, if you are the node between 2 people you basically fund the transactions going through, they sign a transaction to you, you sign a transaction to them for the equal amount each (so you need twice the amount for the channel),
You don't need twice the amount. It's
just the amount because of the way sequence and timelocks are set up to work.
then throughout the length of time of the channel being open you sign transactions back and forth with the people connected to your node then settle everything at the end or whenever someone wants to settle the balance.
Firstly, is that somewhat accurate? I am sure it is super complicated beyond that, otherwise I would know it better.
More than somewhat. Yes, the details are hairy, but that's the basic idea. One important missing piece is that you need to to have more than 1 channel open in order to route funds. You can close one of your channels when you feel like it.
My question (if that is accurate) is, could I sign every possible transaction for each node connecting to me offline, then only move the signed transactions to a hot database that I pull the transactions from as needed?
For example, A and B connect to me with 1 BTC each. I copy their public key to an offline machine and have it generate a million transactions each (or however many are needed) to account for every possible signed transaction then transfer that to a computer online.
Also, if this is possible, what prevents me from signing all of those transactions then spending the bitcoins somewhere else. Or is this what SegWit fixed?
No you can't do that. You only get some coin from Alice that you must pass on to the opposite end of one of your open channels. Each channel has only two ends: you and the other guy. So you get money on one channel (Alice), you pass it on to Charlie, which will help with another hop, until the coins reach the final destination - Bob, but none of the intermediate nodes knows that. You can't withhold the funds within your node. They must travel onwards.