diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-09-12 11:47:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-12 11:47:27 +0800 |
commit | 743983c82b601e200fa53d4aa8973f83ff628d29 (patch) | |
tree | 25ba7f6974233e062e8a8824ac702ac2c715f5a9 /core/consensus.go | |
parent | 0e8fda250804b9c46232287a18af05e7ccf5bf72 (diff) | |
download | dexon-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar dexon-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.gz dexon-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.bz2 dexon-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.lz dexon-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.xz dexon-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.zst dexon-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.zip |
core: types: use []byte for block Payload type (#101)
Change payload type to []byte instead of [][]byte to make it more
generic. The user of the consensus core should marshal the payload into
a byte slice by themselves.
Diffstat (limited to 'core/consensus.go')
-rw-r--r-- | core/consensus.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/consensus.go b/core/consensus.go index 91ca657..0bc7c7d 100644 --- a/core/consensus.go +++ b/core/consensus.go @@ -517,7 +517,7 @@ func (con *Consensus) PrepareBlock(b *types.Block, con.rbModule.prepareBlock(b) b.Timestamp = proposeTime - b.Payloads = con.app.PreparePayloads(b.Position) + b.Payload = con.app.PreparePayload(b.Position) b.Hash, err = hashBlock(b) if err != nil { return @@ -535,7 +535,7 @@ func (con *Consensus) PrepareGenesisBlock(b *types.Block, if err = con.checkPrepareBlock(b, proposeTime); err != nil { return } - if len(b.Payloads) != 0 { + if len(b.Payload) != 0 { err = ErrGenesisBlockNotEmpty return } |