diff options
author | Felix Lange <fjl@twurst.com> | 2015-12-08 06:24:15 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-12-08 06:24:15 +0800 |
commit | 659d6b9b7cc876660581482e876b6b8ceb6360c2 (patch) | |
tree | 4a753c763b6bc0d98af55051c6e0a864ef0bdcb4 | |
parent | 2a3322ea14ec6d53bccfefb2da2b57b533496315 (diff) | |
parent | 1cecda8333feee3d705fd43b9b7a44b08ce583ec (diff) | |
download | go-tangerine-659d6b9b7cc876660581482e876b6b8ceb6360c2.tar go-tangerine-659d6b9b7cc876660581482e876b6b8ceb6360c2.tar.gz go-tangerine-659d6b9b7cc876660581482e876b6b8ceb6360c2.tar.bz2 go-tangerine-659d6b9b7cc876660581482e876b6b8ceb6360c2.tar.lz go-tangerine-659d6b9b7cc876660581482e876b6b8ceb6360c2.tar.xz go-tangerine-659d6b9b7cc876660581482e876b6b8ceb6360c2.tar.zst go-tangerine-659d6b9b7cc876660581482e876b6b8ceb6360c2.zip |
Merge pull request #2051 from karalabe/store-transaction-fastsync
core: write individual transactions and receipts too on fast sync
-rw-r--r-- | core/blockchain.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index dc6e0835c..9d526e352 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -980,6 +980,18 @@ func (self *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain glog.Fatal(errs[index]) return } + if err := WriteTransactions(self.chainDb, block); err != nil { + errs[index] = fmt.Errorf("failed to write individual transactions: %v", err) + atomic.AddInt32(&failed, 1) + glog.Fatal(errs[index]) + return + } + if err := WriteReceipts(self.chainDb, receipts); err != nil { + errs[index] = fmt.Errorf("failed to write individual receipts: %v", err) + atomic.AddInt32(&failed, 1) + glog.Fatal(errs[index]) + return + } atomic.AddInt32(&stats.processed, 1) } } |