OSDN Git Service
(root)
/
bytom
/
vapor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
66b6c31
)
opt
author
HAOYUatHZ
<haoyu@protonmail.com>
Tue, 18 Jun 2019 09:12:22 +0000
(17:12 +0800)
committer
HAOYUatHZ
<haoyu@protonmail.com>
Tue, 18 Jun 2019 09:12:22 +0000
(17:12 +0800)
federation/synchron/mainchain_keeper.go
patch
|
blob
|
history
diff --git
a/federation/synchron/mainchain_keeper.go
b/federation/synchron/mainchain_keeper.go
index
ffc7a30
..
03b6ba8
100644
(file)
--- a/
federation/synchron/mainchain_keeper.go
+++ b/
federation/synchron/mainchain_keeper.go
@@
-195,13
+195,8
@@
func (m *mainchainKeeper) processDepositTx(chain *orm.Chain, block *types.Block,
return err
}
- for _, input := range crossChainInputs {
- if err := m.db.Create(input).Error; err != nil {
- return errors.Wrap(err, fmt.Sprintf("create DepositFromMainchain input: txid(%s), pos(%d)", tx.ID.String(), input.SourcePos))
- }
- }
-
- return nil
+ // batch insert
+ return m.db.Create(crossChainInputs).Error
}
func (m *mainchainKeeper) getCrossChainReqs(crossTransactionID uint64, tx *types.Tx, statusFail bool) ([]*orm.CrossTransactionReq, error) {