aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-16 10:37:01 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:50 +0800
commitd0d1869fa4f4a0a5c1ddc3d4b8d2899cca43fc6a (patch)
tree4a2eda3baf022e87845d7cc120e9986430e58076 /core
parent04838f384450658d678e44c0f902c0eed9cd04bd (diff)
downloaddexon-d0d1869fa4f4a0a5c1ddc3d4b8d2899cca43fc6a.tar.gz
dexon-d0d1869fa4f4a0a5c1ddc3d4b8d2899cca43fc6a.tar.zst
dexon-d0d1869fa4f4a0a5c1ddc3d4b8d2899cca43fc6a.zip
core: fix nil map initialization
Diffstat (limited to 'core')
-rw-r--r--core/blockchain.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index 88287a21d..8d90c9348 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -230,6 +230,9 @@ func (bc *BlockChain) AddConfirmedBlock(block *coreTypes.Block) {
defer bc.confirmedBlockMu.Unlock()
bc.confirmedBlock[block.Hash] = block
+ if bc.filteredConfirmedBlock[block.Position.ChainID] == nil {
+ bc.filteredConfirmedBlock[block.Position.ChainID] = make(map[coreCommon.Hash]*coreTypes.Block)
+ }
bc.filteredConfirmedBlock[block.Position.ChainID][block.Hash] = block
}
@@ -240,6 +243,10 @@ func (bc *BlockChain) RemoveConfirmedBlock(hash coreCommon.Hash) {
block := bc.confirmedBlock[hash]
delete(bc.filteredConfirmedBlock[block.Position.ChainID], block.Hash)
delete(bc.confirmedBlock, block.Hash)
+
+ if len(bc.filteredConfirmedBlock[block.Position.ChainID]) == 0 {
+ bc.filteredConfirmedBlock[block.Position.ChainID] = nil
+ }
}
func (bc *BlockChain) GetConfirmedBlockByHash(hash coreCommon.Hash) *coreTypes.Block {
543'>Small fix.Carlos Perelló Marín2002-02-252-1/+5 * Sync with translation memory.Carlos Perelló Marín2002-02-232-7485/+7958 * Updated Ukrainian translationYuri Syrota2002-02-221-256/+197 * Updated Ukrainian translationYuri Syrota2002-02-221-205/+186 * UpdateFatih Demir2002-02-212-4751/+15447 * Updated Ukrainian TranslationYuri Syrota2002-02-211-4580/+17761 * Updated Estonian translation by Ivar Smolin <okul@linux.ee>.Tõivo Leedjärv2002-02-202-332/+268 * *** empty log message ***Wang Jian2002-02-171-5152/+5152 * Updated Norwegian (bokmål) translation.Kjartan Maraas2002-02-152-854/+1005 * updated Basque filePablo Saratxaga2002-02-141-364/+308 * Keld did the update...Keld Jørn Simonsen2002-02-131-3082/+267 * Updates with norwegian fuzziesKeld Jørn Simonsen2002-02-131-884/+15092 * updated Basque filePablo Saratxaga2002-02-132-281/+321 * Added Estonian translation.Tõivo Leedjärv2002-02-132-0/+25454 * fixed typo.Akira TAGOH2002-02-122-2/+6 * Updated.Alastair McKinstry2002-02-122-2430/+15552 * updated Basque filePablo Saratxaga2002-02-112-11802/+11151 * Updated Spanish translation.Hector Garcia2002-02-042-2922/+2020 * *** empty log message ***Wang Jian2002-02-042-12938/+19877 * Updated Spanish translation.Hector Garcia2002-02-042-1089/+13404 * Updated Norwegian (bokmål) translation.Kjartan Maraas2002-02-032-431/+398 * Converted French translation to UTF-8.Christophe Merlet2002-01-312-1748/+1752 * Updated Norwegian (bokmål) translation.Kjartan Maraas2002-01-312-1008/+1062 * Updated French translation.Christophe Merlet2002-01-311-1/+1 * Updated French translation.Christophe Merlet2002-01-312-12055/+9084 * Updated Norwegian nynorsk translationRoy-Magne Mo2002-01-301-574/+451 * Updated russian translation.Valek Frob2002-01-302-3603/+3156 * Updated Hungarian translationAndras Timar2002-01-282-2156/+13923 * Added missing file. Updated and converted to UTF-8.Christian Rose2002-01-283-4903/+5056 * Updated Norwegian nynorsk translationRoy-Magne Mo2002-01-271-3416/+2520 * Updated Slovenian translationAndraz Tori2002-01-271-4221/+15656 * nl.po Minor translation update....we're getting thereVincent van Adrighem2002-01-271-48/+25 * Updated Norwegian (bokmål) translation. Updated.Kjartan Maraas2002-01-263-3129/+3275 * nl.po Massive translation update All untranslated has been done FuzziesVincent van Adrighem2002-01-251-2017/+2343 * Updated Norwegian (nynorsk) translationRoy-Magne Mo2002-01-252-4716/+15114 * nl.po Translation updateVincent van Adrighem2002-01-241-5525/+4771 * More updates to the Italian translation.Ettore Perazzoli2002-01-242-25/+27 * Updated translation by Clara Tattoni <clara.tattoni@libero.it>.Ettore Perazzoli2002-01-242-1535/+12774 * lv.po - Recommited for two stupid mistakes by me.Peteris Krisjanis2002-01-231-2/+2 * lv.po - Updated Latvian translation.Peteris krisjanis2002-01-232-3147/+15788 * Updated Slovak translation.Stanislav Visnovsky2002-01-222-1415/+792 * UpdatedAlastair McKinstry2002-01-222-1532/+1389 * Updated russian translation.Valek Frob2002-01-212-2355/+14303 * Updated Greek translationSimos Xenitellis2002-01-192-3926/+2861 * Updated Swedish translation.Christian Rose2002-01-142-21/+30 * Updated Norwegian (bokmål) translation.Kjartan Maraas2002-01-142-3681/+13371 * Updated Greek TranslationSimos Xenitellis2002-01-132-5498/+6494 * Updated Swedish translation.Christian Rose2002-01-132-89/+99 * Updated Swedish translation.Christian Rose2002-01-122-126/+132 * Updated Slovak translation.Stanislav Visnovsky2002-01-112-3460/+15181 * *** empty log message ***Wang Jian2002-01-102-779/+565 * Sorted and added LOTS of missing files. Updated Swedish translation.Christian Rose2002-01-093-3355/+3552 * Updated Swedish translation.Christian Rose2002-01-052-295/+346 * Added Basque filePablo Saratxaga2002-01-042-0/+27440 * Updated French translation.Christophe Merlet2002-01-042-1253/+13789 * Updated Swedish translation.Christian Rose2001-12-292-26/+37 * Corrected charset.Fatih Demir2001-12-272-1/+7 * nl.po Sync translations with new .potVincent van Adrighem2001-12-261-4182/+17618 * Updated Greek translationSimos Xenitellis2001-12-232-1692/+14325 * Updated Greek versionSimos Xenitellis2001-12-232-3232/+2600 * nl.po Translation update, we are waaaaay behindVincent van Adrighem2001-12-211-410/+382 * Updated Swedish translation.Christian Rose2001-12-212-308/+342 * routine updateVasif Ismailoglu MD2001-12-201-70/+30 * Fixed Swedish translation. Thanks to Johan Dahlin <zilch.am@home.se> forChristian Rose2001-12-202-114/+119 * Updated Swedish translation.Christian Rose2001-12-192-900/+10275 * *** empty log message ***Wang Jian2001-12-182-552/+19539 * Merging patches from 1-0-branchIain Holmes2001-12-172-1/+176 * Updated Norwegian (nynorsk) translation.Roy-Magne Mo2001-12-171-79/+49 * Updated Norwegian (nynorsk) translation.Roy-Magne Mo2001-12-171-1186/+2812 * Updated Norwegian (nynorsk) translation.Roy-Magne Mo2001-12-171-28/+6 * Updated Norwegian (nynorsk) translation.Roy-Magne Mo2001-12-172-12/+28 * Updated Swedish translation.Christian Rose2001-12-152-216/+1979 * added calendar/zones.hDamon Chaplin2001-12-142-0/+5 * Updated Slovak translation.Stanislav Visnovsky2001-12-132-253/+283 * Updated Swedish translation.Christian Rose2001-12-132-247/+331 * Updated Slovak translation.Stanislav Visnovsky2001-12-112-730/+791 * Updated Ukrainian TranslationYuri Syrota2001-12-111-1369/+785 * *** empty log message ***Wang Jian2001-12-092-746/+4361 * Updated Swedish translation.Christian Rose2001-12-072-357/+403 * Updated Swedish translation.Christian Rose2001-12-022-336/+358 * Updated Spanish translation.Hector Garcia2001-11-302-599/+788 * Updated Norwegian (nynorsk) translation.Roy-Magne Mo2001-11-271-1005/+146 * updated Azeri filePablo Saratxaga2001-11-262-4299/+2212 * Updated Slovenian translationAndraz Tori2001-11-261-1/+1 * Updated Slovenian translationAndraz Tori2001-11-251-3769/+5950 * Updated Slovenian translationAndraz Tori2001-11-241-6259/+3534 * APeteris Krisjanis2001-11-242-0/+14113 * Updated French translation.Christophe Merlet2001-11-232-88/+87 * *** empty log message ***Wang Jian2001-11-202-3073/+3077 * Updated Spanish translationHector Garcia2001-11-202-607/+431 * Updated German translation.Christian Meyer2001-11-202-361/+213 * *** empty log message ***Wang Jian2001-11-192-351/+835 * *** empty log message ***Wang Jian2001-11-191-351/+49 * Updated Greek translationSimos Xenitellis2001-11-192-382/+281 * Updated Greek translationSimos Xenitellis2001-11-192-2312/+2054 * *** empty log message ***Wang Jian2001-11-172-3126/+3536 * Updated russian translation.Valek Frob2001-11-162-234/+205 * Sync for 0.99.2.Ettore Perazzoli2001-11-1531-13055/+14420 * Updated Swedish translation.Christian Rose2001-11-142-273/+289 * Updated russian translation.Valek Frob2001-11-132-1485/+903 * Updated Slovak translation.Stanislav Visnovsky2001-11-132-227/+241 * Updated Hungarian translation.Andras Timar2001-11-132-79/+113 * Updated Polish translation by GNOME PL Team <translators@gnome.pl>Chyla Zbigniew2001-11-132-3466/+3474 * Updated russian translation.Valek Frob2001-11-122-1150/+842 * Updated Hungarian translation.Andras Timar2001-11-122-1120/+904 * Update from annaKeld Jørn Simonsen2001-11-121-185/+1 * Updated Norwegian (bokmål) translation.Kjartan Maraas2001-11-112-263/+263 * *** empty log message ***Wang Jian2001-11-102-863/+924 * Updated Greek translationSimos Xenitellis2001-11-102-1369/+783 * Updates from anna evolution/po/da.poKeld Jørn Simonsen2001-11-101-505/+463 * Updated Slovak translation.Stanislav Visnovsky2001-11-092-287/+147 * Re-enable traditional Chinese translation and convert to UTF8Kwok-Koon Cheung2001-11-092-3064/+3068 * Some QA changes.Carlos Perelló Marín2001-11-092-115/+132 * Fix error in french translationFrédéric Crozat2001-11-092-2/+6 * Updated Brazilian Portuguese translation.Gustavo Maciel Dias Vieira2001-11-092-89/+27 * *** empty log message ***Wang Jian2001-11-082-2751/+2213 * Updated Finnish translation.jjranta2001-11-082-1323/+496 * Updated Swedish translation.Christian Rose2001-11-082-28/+32 * Updated Spanish translation.Hector Garcia2001-11-082-177/+137 * A useless update.Kwok-Koon Cheung2001-11-082-3674/+4981 * Small update of Norwegian nynorsk translation.Roy-Magne Mo2001-11-072-157/+116 * *** empty log message ***Carlos Perelló Marín2001-11-071-1/+2 * *** empty log message ***Carlos Perelló Marín2001-11-061-1/+1 * 0.99.0.Ettore Perazzoli2001-11-0631-15114/+18241 * Updated Polish translation by GNOME PL Team <translators@gnome.pl>Chyla Zbigniew2001-11-05