OSDN Git Service

fk
authorHAOYUatHZ <haoyu@protonmail.com>
Sat, 15 Jun 2019 23:01:33 +0000 (07:01 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Sat, 15 Jun 2019 23:01:33 +0000 (07:01 +0800)
federation/warder.go

index be08163..e45c740 100644 (file)
@@ -47,6 +47,19 @@ func (w *warder) Run() {
                        }).Warnln("signDestTx")
                        continue
                }
+
+               // TODO: elect signer & request sign
+
+               if w.isTxSignsReachQuorum(destTx) && w.isLeader() {
+                       if err := w.submitTx(destTx); err != nil {
+                               log.WithFields(log.Fields{
+                                       "err":            err,
+                                       "cross-chain tx": ormTx,
+                                       "dest tx":        destTx,
+                               }).Warnln("submitTx")
+                               continue
+                       }
+               }
        }
 }
 
@@ -112,3 +125,15 @@ func (w *warder) signDestTx(destTx interface{}, tx *orm.CrossTransaction) error
 
        return nil
 }
+
+func (w *warder) isTxSignsReachQuorum(destTx interface{}) bool {
+       return false
+}
+
+func (w *warder) submitTx(destTx interface{}) error {
+       return nil
+}
+
+func (w *warder) isLeader() bool {
+       return false
+}