OSDN Git Service

clean
authorHAOYUatHZ <haoyu@protonmail.com>
Fri, 14 Jun 2019 01:56:28 +0000 (09:56 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Fri, 14 Jun 2019 01:56:28 +0000 (09:56 +0800)
federation/common/const.go
federation/synchron/commob.go [new file with mode: 0644]
federation/synchron/mainchain_keeper.go
federation/synchron/sidechain_keeper.go

index 0a91d33..e843f9e 100644 (file)
@@ -1,9 +1,5 @@
 package common
 
-import (
-       "github.com/vapor/errors"
-)
-
 const (
        CrossTxPendingStatus uint8 = iota
        CrossTxRejectedStatus
@@ -16,5 +12,3 @@ const (
        CrossTxSignCompletedStatus
        CrossTxSignRejectedStatus
 )
-
-var ErrInconsistentDB = errors.New("inconsistent db status")
diff --git a/federation/synchron/commob.go b/federation/synchron/commob.go
new file mode 100644 (file)
index 0000000..cef5c62
--- /dev/null
@@ -0,0 +1,7 @@
+package synchron
+
+import (
+       "github.com/vapor/errors"
+)
+
+var ErrInconsistentDB = errors.New("inconsistent db status")
index 13a315f..a7e7e75 100644 (file)
@@ -90,7 +90,7 @@ func (m *mainchainKeeper) syncBlock() (bool, error) {
                        "remote PreviousBlockHash": nextBlock.PreviousBlockHash.String(),
                        "db block_hash":            chain.BlockHash,
                }).Fatal("BlockHash mismatch")
-               return false, common.ErrInconsistentDB
+               return false, ErrInconsistentDB
        }
 
        if err := m.tryAttachBlock(chain, nextBlock, txStatus); err != nil {
@@ -262,7 +262,7 @@ func (m *mainchainKeeper) processChainInfo(chain *orm.Chain, block *types.Block)
        }
 
        if res.RowsAffected != 1 {
-               return common.ErrInconsistentDB
+               return ErrInconsistentDB
        }
 
        return nil
index 577a6e0..18ec269 100644 (file)
@@ -85,7 +85,7 @@ func (s *sidechainKeeper) syncBlock() (bool, error) {
                        "remote PreviousBlockHash": nextBlock.PreviousBlockHash.String(),
                        "db block_hash":            chain.BlockHash,
                }).Fatal("BlockHash mismatch")
-               return false, common.ErrInconsistentDB
+               return false, ErrInconsistentDB
        }
 
        if err := s.tryAttachBlock(chain, nextBlock, txStatus); err != nil {
@@ -253,7 +253,7 @@ func (s *sidechainKeeper) processChainInfo(chain *orm.Chain, block *types.Block)
        }
 
        if res.RowsAffected != 1 {
-               return common.ErrInconsistentDB
+               return ErrInconsistentDB
        }
 
        return nil