package common
+import (
+ "github.com/vapor/errors"
+)
+
const (
CrossTxPendingStatus uint8 = iota
CrossTxRejectedStatus
CrossTxSignCompletedStatus
CrossTxSignRejectedStatus
)
+
+var ErrInconsistentDB = errors.New("inconsistent db status")
+++ /dev/null
-package synchron
-
-import (
- vaporCfg "github.com/vapor/config"
- "github.com/vapor/errors"
-)
-
-var (
- fedProg = vaporCfg.FederationProgrom(vaporCfg.CommonConfig)
-
- ErrInconsistentDB = errors.New("inconsistent db status")
-)
"github.com/jinzhu/gorm"
log "github.com/sirupsen/logrus"
+ vaporCfg "github.com/vapor/config"
"github.com/vapor/errors"
"github.com/vapor/federation/common"
"github.com/vapor/federation/config"
"github.com/vapor/protocol/bc"
)
+var fedProg = vaporCfg.FederationProgrom(vaporCfg.CommonConfig)
+
type mainchainKeeper struct {
cfg *config.Chain
db *gorm.DB
"remote PreviousBlockHash": nextBlock.PreviousBlockHash.String(),
"db block_hash": chain.BlockHash,
}).Fatal("BlockHash mismatch")
- return false, ErrInconsistentDB
+ return false, common.ErrInconsistentDB
}
if err := m.tryAttachBlock(chain, nextBlock, txStatus); err != nil {
}
if res.RowsAffected != 1 {
- return ErrInconsistentDB
+ return common.ErrInconsistentDB
}
return nil
"remote PreviousBlockHash": nextBlock.PreviousBlockHash.String(),
"db block_hash": chain.BlockHash,
}).Fatal("BlockHash mismatch")
- return false, ErrInconsistentDB
+ return false, common.ErrInconsistentDB
}
if err := s.tryAttachBlock(chain, nextBlock, txStatus); err != nil {
}
if res.RowsAffected != 1 {
- return ErrInconsistentDB
+ return common.ErrInconsistentDB
}
return nil