aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-10-22 20:43:21 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-11-19 22:03:32 +0800
commite86e0ecdc8a977db2ff5df60dca3cad8355ace6d (patch)
tree5944b33220457ad5da31b33e15774882c2e6201f /core/blockchain.go
parentae37a8013d5a348bdb21d4a66d5f462e0baf7cd8 (diff)
downloaddexon-e86e0ecdc8a977db2ff5df60dca3cad8355ace6d.tar
dexon-e86e0ecdc8a977db2ff5df60dca3cad8355ace6d.tar.gz
dexon-e86e0ecdc8a977db2ff5df60dca3cad8355ace6d.tar.bz2
dexon-e86e0ecdc8a977db2ff5df60dca3cad8355ace6d.tar.lz
dexon-e86e0ecdc8a977db2ff5df60dca3cad8355ace6d.tar.xz
dexon-e86e0ecdc8a977db2ff5df60dca3cad8355ace6d.tar.zst
dexon-e86e0ecdc8a977db2ff5df60dca3cad8355ace6d.zip
core, eth, miner, xeth: clean up tx/receipt db accessors
Diffstat (limited to 'core/blockchain.go')
-rw-r--r--core/blockchain.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index b6b00ca04..5e1fc9424 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -972,7 +972,7 @@ func (self *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain
glog.Fatal(errs[index])
return
}
- if err := PutBlockReceipts(self.chainDb, block.Hash(), receipts); err != nil {
+ if err := WriteBlockReceipts(self.chainDb, block.Hash(), receipts); err != nil {
errs[index] = fmt.Errorf("failed to write block receipts: %v", err)
atomic.AddInt32(&failed, 1)
glog.Fatal(errs[index])
@@ -1182,7 +1182,7 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
// coalesce logs for later processing
coalescedLogs = append(coalescedLogs, logs...)
- if err := PutBlockReceipts(self.chainDb, block.Hash(), receipts); err != nil {
+ if err := WriteBlockReceipts(self.chainDb, block.Hash(), receipts); err != nil {
return i, err
}
@@ -1201,11 +1201,11 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
events = append(events, ChainEvent{block, block.Hash(), logs})
// This puts transactions in a extra db for rpc
- if err := PutTransactions(self.chainDb, block, block.Transactions()); err != nil {
+ if err := WriteTransactions(self.chainDb, block); err != nil {
return i, err
}
// store the receipts
- if err := PutReceipts(self.chainDb, receipts); err != nil {
+ if err := WriteReceipts(self.chainDb, receipts); err != nil {
return i, err
}
// Write map map bloom filters
@@ -1294,12 +1294,12 @@ func (self *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
// insert the block in the canonical way, re-writing history
self.insert(block)
// write canonical receipts and transactions
- if err := PutTransactions(self.chainDb, block, block.Transactions()); err != nil {
+ if err := WriteTransactions(self.chainDb, block); err != nil {
return err
}
receipts := GetBlockReceipts(self.chainDb, block.Hash())
// write receipts
- if err := PutReceipts(self.chainDb, receipts); err != nil {
+ if err := WriteReceipts(self.chainDb, receipts); err != nil {
return err
}
// Write map map bloom filters