OSDN Git Service

fix fix_crossin_api
authorwz <mars@bytom.io>
Mon, 25 Nov 2019 02:47:00 +0000 (10:47 +0800)
committerwz <mars@bytom.io>
Mon, 25 Nov 2019 02:47:00 +0000 (10:47 +0800)
blockchain/txbuilder/actions.go

index ae9fcb0..994e03c 100644 (file)
@@ -156,8 +156,8 @@ type crossOutAction struct {
 
 func (a *crossOutAction) Build(ctx context.Context, b *TemplateBuilder) error {
        var missing []string
-       if a.Address == "" {
-               missing = append(missing, "address")
+       if a.Address == "" && len(a.Program) == 0 {
+               missing = append(missing, "address or program")
        }
        if a.AssetId.IsZero() {
                missing = append(missing, "asset_id")