Author

Topic: Bounty: A zero-confirm modified bitcoind (Read 999 times)

full member
Activity: 154
Merit: 100
May 21, 2013, 09:35:32 AM
#2
Satoshi-dice is based on BitcoinJ. One of the example projects is called PingService which listens for incoming transactions and then sends them back where they came which is pretty much the entire functionality of Satoshi-dice.
newbie
Activity: 10
Merit: 0
I'm trying to figure out how the Satoshi dice 0-confirm transactions are conducted. I have drilled down to the following code and made comments based on my understanding. Let me know if I am correct in these comments. Also where should I start looking to chain the incoming transaction to the outgoing transaction? I am willing to pay for someone to whip up a bit of code as the rest of the project is complete except for this part.

Code:
bool CWallet::SelectCoins(int64 nTargetValue, set >& setCoinsRet, int64& nValueRet) const
{
    vector vCoins;
    AvailableCoins(vCoins);


//SelectCoinsMinConf
//int64 nTargetValue, int nConfMine, int nConfTheirs, vector vCoins, set >& setCoinsRet, int64& nValueRet)
//First number is if local transaction required "1", "6" is receive by foreign.
    return (SelectCoinsMinConf(nTargetValue, 1, 6, vCoins, setCoinsRet, nValueRet) || //Changing 6 to 0 may make it allow 0 confirmed coins be able to be sent
            SelectCoinsMinConf(nTargetValue, 1, 1, vCoins, setCoinsRet, nValueRet) ||
            SelectCoinsMinConf(nTargetValue, 0, 1, vCoins, setCoinsRet, nValueRet));
}

Thanks guys

Jump to: