Created
June 28, 2018 23:16
-
-
Save mgraczyk/797449b6a56658bfd8165070cffe6885 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [OT] This case corresponds to onGenerateTx in the paper. | |
case *messages.ApiReceiveTransaction: | |
// [OT] small race, should be `utxo := atomic.Add...() - 1` | |
// already being fixed by Perlin | |
utxo := atomic.LoadUint64(&messages.LastUTXO) | |
atomic.AddUint64(&messages.LastUTXO, 1) | |
body := messages.CreateTx(utxo, store.GetKeys().PublicKeyHex(), state.node.SelectParents(), msg.Data) | |
state.node.OnReceiveTx(body.Sign(store.GetKeys())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment