aboutsummaryrefslogtreecommitdiffstats
path: root/core/lattice.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-10-12 19:36:32 +0800
committerGitHub <noreply@github.com>2018-10-12 19:36:32 +0800
commit09f943d9d4ebd151a8c6fdbd15ca3282edbc7e94 (patch)
tree61eb287e8119f0de7670cb7a98dfa35cd431cc82 /core/lattice.go
parent48f5fdb27e3218e2476b27ae99bcf242533b3bc3 (diff)
downloadtangerine-consensus-09f943d9d4ebd151a8c6fdbd15ca3282edbc7e94.tar.gz
tangerine-consensus-09f943d9d4ebd151a8c6fdbd15ca3282edbc7e94.tar.zst
tangerine-consensus-09f943d9d4ebd151a8c6fdbd15ca3282edbc7e94.zip
core: modify interface (#194)
* Add a new method to notify full node about round cutting. * Modify interface to return error when preparing block
Diffstat (limited to 'core/lattice.go')
-rw-r--r--core/lattice.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/lattice.go b/core/lattice.go
index d634650..ab8aaec 100644
--- a/core/lattice.go
+++ b/core/lattice.go
@@ -79,8 +79,12 @@ func (s *Lattice) PrepareBlock(
if err = s.data.prepareBlock(b); err != nil {
return
}
- b.Payload = s.app.PreparePayload(b.Position)
- b.Witness = s.app.PrepareWitness(b.Witness.Height)
+ if b.Payload, err = s.app.PreparePayload(b.Position); err != nil {
+ return
+ }
+ if b.Witness, err = s.app.PrepareWitness(b.Witness.Height); err != nil {
+ return
+ }
if err = s.authModule.SignBlock(b); err != nil {
return
}