Remove some legacy lines and fix some comments for consensus and blocks

pull/17/head
Rongjian Lan 6 years ago
parent a8be1dd841
commit d9ff51d534
  1. 2
      blockchain/utxopool.go
  2. 14
      consensus/consensus_leader.go
  3. 2
      node/node_handler.go

@ -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
}
}

@ -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
}
}

@ -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")

Loading…
Cancel
Save