Interesting behavior now... I can send the coins from the genesis block, but they never confirm.
Yes, I don't think adding to the memory pool is going to help with what you are trying to do.
The memory pool is for transactions that are not yet in blocks. When a new transaction is created, it gets relayed to nodes across the network and stored in their memory pools. Mining nodes use the memory pool to find transactions to include in mined blocks. The genesis block transaction doesn't really belong there since it is already part of a block (and also since it is a coinbase transaction).
You need to add the transaction to the set of unspent transaction outputs. I don't know exactly how to do it properly, but the critical piece of code seems to be the call to SetCoins in CTransaction::UpdateCoins(). You might be able to do it like this:
CCoinsViewCache view(*pcoinsTip, true);
view.SetCoins(txNew.GetHash(), CCoins(txNew, 0));
view.Flush();
I'd recommend putting that code right where the genesis block is created: in main.cpp, in InitBlockIndex(), inside "if (!fReindex)", right at the end. I can't guarantee that it will work, but it might. Make sure you start with a fresh data directory.
To make reindexing work, I think you'll also need to do the same thing in CBlock::ConnectBlock inside this special case for the genesis block:
// Special case for the genesis block, skipping connection of its transactions
// (its coinbase is unspendable)
if (GetHash() == hashGenesisBlock) {
CCoinsViewCache viewTmp(view, true);
viewTmp.SetCoins(vtx[0].GetHash(), CCoins(vtx[0], 0));
viewTmp.Flush();
view.SetBestBlock(pindex);
pindexGenesisBlock = pindex;
return true;
}
Or maybe you can simply remove the special case and let the rest of the function run, but I don't know if any of the rest of the code in that function will create problems.