mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-29 20:51:45 +00:00
broadcast_commit
This commit is contained in:
@ -6,6 +6,13 @@ import (
|
||||
|
||||
type Tx []byte
|
||||
|
||||
// NOTE: this is the hash of the go-wire encoded Tx.
|
||||
// Tx has no types at this level, so just length-prefixed.
|
||||
// Maybe it should just be the hash of the bytes tho?
|
||||
func (tx Tx) Hash() []byte {
|
||||
return merkle.SimpleHashFromBinary(tx)
|
||||
}
|
||||
|
||||
type Txs []Tx
|
||||
|
||||
func (txs Txs) Hash() []byte {
|
||||
@ -15,7 +22,7 @@ func (txs Txs) Hash() []byte {
|
||||
case 0:
|
||||
return nil
|
||||
case 1:
|
||||
return merkle.SimpleHashFromBinary(txs[0])
|
||||
return txs[0].Hash()
|
||||
default:
|
||||
left := Txs(txs[:(len(txs)+1)/2]).Hash()
|
||||
right := Txs(txs[(len(txs)+1)/2:]).Hash()
|
||||
|
Reference in New Issue
Block a user