Skip to content

Commit

Permalink
Remove some legacy lines and fix some comments for consensus and blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
rlan35 committed Jun 30, 2018
1 parent a8be1dd commit d9ff51d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions blockchain/utxopool.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ func (utxoPool *UTXOPool) UpdateOneTransaction(tx *Transaction) {
}
}
} // If it's a cross shard locking Tx, then don't update so the input UTXOs are locked (removed), and the money is not spendable until unlock-to-commit or unlock-to-abort

// TODO: unlock-to-commit and unlock-to-abort
}
}

Expand Down
14 changes: 6 additions & 8 deletions consensus/consensus_leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,14 @@ func (consensus *Consensus) processCommitMessage(payload []byte) {
}

if len(consensus.commits) >= (2*len(consensus.validators))/3+1 && consensus.state < CHALLENGE_DONE {
if len(consensus.commits) >= (2*len(consensus.validators))/3+1 && consensus.state < CHALLENGE_DONE {
consensus.Log.Debug("Enough commits received with signatures", "numOfSignatures", len(consensus.commits))
consensus.Log.Debug("Enough commits received with signatures", "numOfSignatures", len(consensus.commits))

// Broadcast challenge
msgToSend := consensus.constructChallengeMessage()
p2p.BroadcastMessage(consensus.validators, msgToSend)
// Broadcast challenge
msgToSend := consensus.constructChallengeMessage()
p2p.BroadcastMessage(consensus.validators, msgToSend)

// Set state to CHALLENGE_DONE
consensus.state = CHALLENGE_DONE
}
// Set state to CHALLENGE_DONE
consensus.state = CHALLENGE_DONE
}
}

Expand Down
2 changes: 1 addition & 1 deletion node/node_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (node *Node) SendBackProofOfAcceptOrReject() {
}

// This is called by consensus leader to sync new blocks with other clients/nodes.
// For now, just send to the client.
// NOTE: For now, just send to the client (basically not broadcasting)
func (node *Node) BroadcastNewBlock(newBlock *blockchain.Block) {
if node.ClientPeer != nil {
node.log.Debug("SENDING NEW BLOCK TO CLIENT")
Expand Down

0 comments on commit d9ff51d

Please sign in to comment.