Skip to content

Instantly share code, notes, and snippets.

@mgraczyk

mgraczyk/perlin10.go

Created Jun 28, 2018
Embed
What would you like to do?
func (n *Node) IsAccepted(tx *Transaction) bool {
mutex.RLock()
defer mutex.RUnlock()
committed := false
for _, parent := range tx.Body.GetParents() {
parent := n.Transactions[parent]
committed = committed && n.IsAccepted(parent)
}
set := n.Conflicts[tx.Body.Utxo]
// [OT] safe early commitment.
committed = committed && len(set.Transactions) == 1
committed = committed && (n.Confidence(tx) > Beta1)
if !committed && set.Preferred == tx {
// [OT] consecutive counter
return set.Count > Beta2
}
return committed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.