aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_util.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-26 03:48:53 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-26 03:48:53 +0800
commitc1c895a36b420d58431cf483bd3ed602227892fc (patch)
tree3a8ad9acc57bc63c3f14c14911df900ed264d759 /core/chain_util.go
parent73a576c9af5038366f50509136a91a86d203fc6b (diff)
downloadgo-tangerine-c1c895a36b420d58431cf483bd3ed602227892fc.tar.gz
go-tangerine-c1c895a36b420d58431cf483bd3ed602227892fc.tar.zst
go-tangerine-c1c895a36b420d58431cf483bd3ed602227892fc.zip
core: fixed genesis write out to write only canon number
Diffstat (limited to 'core/chain_util.go')
-rw-r--r--core/chain_util.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/chain_util.go b/core/chain_util.go
index a67fdb135..38273d2f0 100644
--- a/core/chain_util.go
+++ b/core/chain_util.go
@@ -111,13 +111,22 @@ func GetBlockByNumber(db common.Database, number uint64) *types.Block {
return GetBlockByHash(db, common.BytesToHash(key))
}
-// WriteHead force writes the current head
-func WriteHead(db common.Database, block *types.Block) error {
+// WriteCanonNumber writes the canonical hash for the given block
+func WriteCanonNumber(db common.Database, block *types.Block) error {
key := append(blockNumPre, block.Number().Bytes()...)
err := db.Put(key, block.Hash().Bytes())
if err != nil {
return err
}
+ return nil
+}
+
+// WriteHead force writes the current head
+func WriteHead(db common.Database, block *types.Block) error {
+ err := WriteCanonNumber(db, block)
+ if err != nil {
+ return err
+ }
err = db.Put([]byte("LastBlock"), block.Hash().Bytes())
if err != nil {
return err
a76ed15368176b937f2b06dad88f13e12f4f0'>KDE/FreeBSD team is happy to present Qt 5 in ports!makc2014-03-041-0/+7 * - Whitespace cleanupmiwi2014-01-291-11/+11 * Add two new options helpers:mat2014-01-281-0/+11 * New USES=uniquefiles to make files or directories uniquemva2014-01-121-0/+38 * - Remove lang/python as implicit build and run dependency frommva2013-12-191-0/+22 * New USES=fortran to replace USE_FORTRAN.tijl2013-12-131-0/+14 * New USES=twisted, to replace the old USE_TWISTED knob.mva2013-12-081-0/+17 * Remove ltverhack's hard depend on USE_AUTOTOOLS=libtool.kwm2013-11-201-0/+15 * Indent 20131031 entry like the rest of the file.kwm2013-11-201-10/+10 * Add a description of USES=kmodrene2013-10-311-0/+14 * - Remove manual creation and removal of share/applications, as it's now in th...amdmi32013-10-221-0/+6 * - Fix typosunpoet2013-10-201-1/+1 * New USES=compilerbapt2013-10-091-0/+18 * - Add new USES= qmake (with staging support)makc2013-10-091-0/+8 * - PATCHFILES now support an optional :-pX flag that notes which patch stripbdrewery2013-10-051-0/+9 * Introduce the new "scons" USES. The goal is to replace the old bsd.scons.mkbapt2013-10-031-0/+6 * Add an entry about "create packages as a user"bapt2013-09-241-3/+16 * - add new USES target: zope, and convert the tree to itrm2013-09-231-0/+8 * Add support for staging area in the ports treebapt2013-09-231-0/+29 * - Rename public name of SSP support to WITH_SSP_PORTS as /usr/srcbdrewery2013-09-221-2/+2 * SSP support has been added to ports with WITH_SSP for i386 and amd64bdrewery2013-09-201-0/+22 * - Document the addition of tcl/tk to the USES and DEFAULT_VERSIONS framework.gahr2013-09-191-0/+14 * Remove the old perl framework, that also means all the perl code is not loade...bapt2013-09-181-0/+11 * - proper formatingaz2013-09-071-1/+4 * - Make ports use the libc provided iconv implementation on 10-CURRENTmadpilot2013-09-051-0/+18 * Back to the presentbapt2013-09-041-1/+1 * Document the removal of USE_GNOME=pkgconfigbapt2013-09-021-0/+6 * - Add USE_PACKAGE_DEPENDS_ONLY which will try installing dependenciesbdrewery2013-08-311-0/+7 * Back to the presentbapt2013-07-311-1/+1 * Typobapt2013-07-311-1/+1 * Document the new USE=perl5bapt2013-07-311-0/+33 * KDE3 and QT3 expired on 2013-07-01, remove these ports.rene2013-07-271-0/+10 * New USES imake to handle the dependency on imake.bapt2013-06-281-0/+12 * Fix AUTHORS line in the last entrybapt2013-06-261-1/+2 * Add a new USES: fmakebapt2013-06-201-1/+8 * Fix two typos: add two trailing curly braces.bsam2013-06-201-2/+2 * Document the fact that _DEPENDS now also has per options helpersbapt2013-06-141-0/+3 * Add a forgotten helper:bapt2013-06-141-0/+6 * New macros to help dealing with ports that have options:bapt2013-06-141-0/+31 * Add a USES display to replace USE_DISPLAY.bapt2013-06-141-0/+13 * Fix ports using GH_TAGNAME=master to depend on a known hashbdrewery2013-06-081-0/+8 * Add WRKSRC_SUBDIR to simplify overriding WRKSRC:bdrewery2013-06-071-0/+12 * Wordingbapt2013-06-061-2/+2 * Remove support for parsing the old OPTIONS macro, the compatibility code to l...bapt2013-06-061-0/+6 * Document new USES: desktop-file-utils and shared-mime-info.kwm2013-05-091-0/+26 * USE_GETTEXT has totally been replaced by USES=gettext thanks, jgh and akbapt2013-05-071-0/+2 * Add new USES: shebangfixbapt2013-05-071-0/+10 * Add new USES: ncurses and readlinebapt2013-05-061-0/+16 * Introduces USES= iconv to replace USE_ICONV.mva2013-04-271-1/+8 * Remove USE_CDRTOOLS from bsd.port.mkbapt2013-04-261-0/+1 * Remove USE_FREETYPE from bsd.port.mkbapt2013-04-261-0/+5 * Introduces USES= gettext to replace USE_GETTEXTjgh2013-04-231-0/+13 * Fix datebapt2013-04-231-1/+1 * - Add WITH_CCACHE_BUILD support during 'configure' phasebdrewery2013-04-231-0/+9 * Introduce USES= pkgconfig to replace USE_PKGCONFIGbapt2013-04-231-0/+12 * - Add New USES macro to handle support for Zenoss ports and Zenpacks:jgh2013-03-201-0/+7 * Convert USE_CMAKE to USES macro:makc2013-03-201-0/+15 * Make the ports tree use dialog4ports for make config.bapt2013-03-191-0/+10 * Document USES=qmailbdrewery2013-03-161-0/+11 * Document the introduction of Keywords/info.yaml in CHANGESbapt2013-03-151-0/+7 * Add a note about the new USES macro and the new USES= pathfix fusebapt2013-03-071-0/+9 * - Fix Whitespacesmiwi2013-02-081-1/+1 * - Document that PTHREAD_CFLAGS and PTHREAD_LIBS are unsupportedgahr2013-02-071-0/+7 * - introduce a USE_FUSE macroflo2012-12-141-0/+7 * Extend the options framework providing 2 new macros:bapt2012-12-101-0/+7 * Minor whitespace and formatting fixes.danfe2012-11-171-3/+3 * We are in 2012, it is time to activate IPV6 options by default everywherebapt2012-10-101-0/+5 * Switching current to use pkgng by defaultbapt2012-10-101-0/+10 * - Add ccache support for building ports. [1]beat2012-08-301-0/+16 * - Add support for fetching from GitHub in bsd.sites.mkgahr2012-08-201-0/+22 * new devel/pkgconf added to replace devel/pkg-config. new version of pkg-configbapt2012-07-261-0/+15 * - use UPDATING instead CHANGESohauer2012-07-231-5/+0 * - use reserverd UID/GIDohauer2012-07-211-0/+5 * - Keep questions on a public mailing listbeat2012-07-161-1/+1 * - Add a note about the switch to Subversionbeat2012-07-161-0/+15 * - Fix copy-paste errorak2012-06-251-2/+2