| 376 | } |
| 377 | |
| 378 | func parseScriptFlag(s string) (uint32, error) { |
| 379 | var res uint32 |
| 380 | words := strings.Split(s, ",") |
| 381 | for _, w := range words { |
| 382 | if w == "" { |
| 383 | continue |
| 384 | } |
| 385 | if flag, ok := scriptFlagMap[w]; ok { |
| 386 | res |= flag |
| 387 | } else { |
| 388 | return 0, fmt.Errorf("not found script flag for name %s", w) |
| 389 | } |
| 390 | } |
| 391 | return res, nil |
| 392 | } |
| 393 | |
| 394 | func signMultisig(scriptPubKey *script.Script, keys []crypto.PrivateKey, transaction *tx.Tx) *script.Script { |
| 395 | hash, _ := tx.SignatureHash(transaction, scriptPubKey, |