aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-09-12 11:47:27 +0800
committerGitHub <noreply@github.com>2018-09-12 11:47:27 +0800
commit743983c82b601e200fa53d4aa8973f83ff628d29 (patch)
tree25ba7f6974233e062e8a8824ac702ac2c715f5a9 /core/consensus.go
parent0e8fda250804b9c46232287a18af05e7ccf5bf72 (diff)
downloadtangerine-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar
tangerine-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.gz
tangerine-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.bz2
tangerine-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.lz
tangerine-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.xz
tangerine-consensus-743983c82b601e200fa53d4aa8973f83ff628d29.tar.zst
tangerine-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.go4
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
}