aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-09-10 22:12:39 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-09-11 21:40:00 +0800
commit4bb25042eb957662155079e06bb2efbdd866eb99 (patch)
tree87e6833f5c30b0bf2cec878f4689f689572c058b /core/chain_makers.go
parent10bac3664702f31228eafedecf31e9bf115f6c29 (diff)
downloaddexon-4bb25042eb957662155079e06bb2efbdd866eb99.tar.gz
dexon-4bb25042eb957662155079e06bb2efbdd866eb99.tar.zst
dexon-4bb25042eb957662155079e06bb2efbdd866eb99.zip
consensus/clique, core: chain maker clique + error tests
Diffstat (limited to 'core/chain_makers.go')
-rw-r--r--core/chain_makers.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/chain_makers.go b/core/chain_makers.go
index de0fc6be9..351673477 100644
--- a/core/chain_makers.go
+++ b/core/chain_makers.go
@@ -67,6 +67,11 @@ func (b *BlockGen) SetExtra(data []byte) {
b.header.Extra = data
}
+// SetNonce sets the nonce field of the generated block.
+func (b *BlockGen) SetNonce(nonce types.BlockNonce) {
+ b.header.Nonce = nonce
+}
+
// AddTx adds a transaction to the generated block. If no coinbase has
// been set, the block's coinbase is set to the zero address.
//
@@ -190,13 +195,14 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(b.header.Number) == 0 {
misc.ApplyDAOHardFork(statedb)
}
- // Execute any user modifications to the block and finalize it
+ // Execute any user modifications to the block
if gen != nil {
gen(i, b)
}
-
if b.engine != nil {
+ // Finalize and seal the block
block, _ := b.engine.Finalize(b.chainReader, b.header, statedb, b.txs, b.uncles, b.receipts)
+
// Write state changes to db
root, err := statedb.Commit(config.IsEIP158(b.header.Number))
if err != nil {
d=b7052341afed88de0a73210331237df2544cfd3c'>Make it clear that pkgng is optionaleadler2013-02-061-5/+5 * osc is a command-line client fot openSUSE build service. It isamdmi32013-02-065-0/+142 * - Update to 3.5.0zi2013-02-062-7/+4 * - Remove indefinite article from COMMENTbdrewery2013-02-061-6/+7 * New upstream release v0.9.1.mandree2013-02-062-3/+3 * - Add */hs-* to the previous updating entry for Haskell portspgj2013-02-061-1/+1 * - Fix breakage in the DYNAMIC-enabled ports triggered by the recentpgj2013-02-06573-897/+1767 * - Update to 2.0.20130126gblach2013-02-064-48/+6 * - Update to 0.6.4tota2013-02-062-4/+3 * - update to 3.2.7flo2013-02-062-3/+7 * - Chase removal of Tcl/Tk 8.2gahr2013-02-061-1/+1 * - Update to 1.60culot2013-02-064-24/+9 * - Convert to new options frameworksunpoet2013-02-061-9/+8 * - Convert to new options frameworksunpoet2013-02-061-10/+8 * - Convert to new options frameworksunpoet2013-02-061-9/+8 * Add a note about libreoffice upgrade which conflicts with libcmis 0.1 ifbapt2013-02-061-0/+9 * CyaSSL 2.5.0 includes bug fixes, a fix for the "Lucky 13" TLS CBC paddingjohans2013-02-063-3/+5 * Fix build on FreeBSD 9+bapt2013-02-061-3/+3 * Update from 1.3.11 to 1.3.12.osa2013-02-062-6/+6 * - Update to 1.1.2gahr2013-02-063-5/+37 * - Add UPDATING entry for gnutls updatenovel2013-02-06