OSDN Git Service

what can i say
authorHAOYUatHZ <haoyu@protonmail.com>
Fri, 21 Jun 2019 03:23:55 +0000 (11:23 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Fri, 21 Jun 2019 03:23:55 +0000 (11:23 +0800)
federation/warder.go

index 0f66d4f..a7689fd 100644 (file)
@@ -331,6 +331,17 @@ func (w *warder) getSigns(destTx interface{}, ormTx *orm.CrossTransaction) ([]st
 
 // TODO:
 func (w *warder) attachSignsForTx(destTx interface{}, ormTx *orm.CrossTransaction, position uint8, signs []string) error {
+       var inputsLen int
+       switch destTx := destTx.(type) {
+       case *vaporTypes.Tx:
+               inputsLen = len(destTx.Inputs)
+       case *btmTypes.Tx:
+               inputsLen = len(destTx.Inputs)
+       default:
+               return errUnknownTxType
+       }
+
+       signWitness := make([][]string, inputsLen)
 
        b, err := json.Marshal(signs)
        if err != nil {