Skip to content

Commit

Permalink
reapply FD-568 return processed rather than acked entry commits
Browse files Browse the repository at this point in the history
  • Loading branch information
carryforward committed Aug 12, 2018
1 parent 7510939 commit ba893df
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions state/ack.go
Expand Up @@ -72,14 +72,18 @@ func (s *State) GetEntryCommitAckByTXID(hash interfaces.IHash) (status int, blkt
// We will search the processlist for the commit
// TODO: Is this thread safe?
for _, v := range pl.VMs {
for _, m := range v.List {
for i, m := range v.List {
switch m.Type() {
case constants.COMMIT_CHAIN_MSG:
cc, ok := m.(*messages.CommitChainMsg)
if ok {
if cc.CommitChain.GetSigHash().IsSameAs(hash) {
// Msg found in the latest processlist
status = constants.AckStatusACK
if i > v.Height { // if it has not yet been processed ...
status = constants.AckStatusNotConfirmed
} else {
status = constants.AckStatusACK
}
commit = cc
entryhash = cc.CommitChain.EntryHash
return
Expand All @@ -90,7 +94,11 @@ func (s *State) GetEntryCommitAckByTXID(hash interfaces.IHash) (status int, blkt
if ok {
if ce.CommitEntry.GetSigHash().IsSameAs(hash) {
// Msg found in the latest processlist
status = constants.AckStatusACK
if i > v.Height { // if it has not yet been processed ...
status = constants.AckStatusNotConfirmed
} else {
status = constants.AckStatusACK
}
commit = ce
entryhash = ce.CommitEntry.EntryHash
return
Expand Down

0 comments on commit ba893df

Please sign in to comment.