diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-12-04 21:30:59 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-12-04 21:30:59 +0800 |
commit | 1cecda8333feee3d705fd43b9b7a44b08ce583ec (patch) | |
tree | c105edddf04883ff2d2b57d21873383879330cd9 /core/blockchain.go | |
parent | fece1fa9be769f7b5ef7b1b327e4f6ca0dd80227 (diff) | |
download | go-tangerine-1cecda8333feee3d705fd43b9b7a44b08ce583ec.tar.gz go-tangerine-1cecda8333feee3d705fd43b9b7a44b08ce583ec.tar.zst go-tangerine-1cecda8333feee3d705fd43b9b7a44b08ce583ec.zip |
core: write individual transactions and receipts too on fast sync
Diffstat (limited to 'core/blockchain.go')
-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) } } |