From 9da482119cf26f90a88d8bb169a4532a46a606c2 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 3 Nov 2017 12:25:45 -0700 Subject: [PATCH] gcs/builder: revert recursion of push datas in p2sh/witness --- gcs/builder/builder.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/gcs/builder/builder.go b/gcs/builder/builder.go index 7c63f49..e2aefc9 100644 --- a/gcs/builder/builder.go +++ b/gcs/builder/builder.go @@ -195,14 +195,7 @@ func (b *GCSBuilder) AddScript(script []byte) *GCSBuilder { return b } - b.AddEntries(data) - - // Recurse into each pushed datum and attempt to add it as a script. - for _, datum := range data { - b.AddScript(datum) - } - - return b + return b.AddEntries(data) } // AddWitness adds each item of the passed filter stack to the filter, and then @@ -213,13 +206,7 @@ func (b *GCSBuilder) AddWitness(witness wire.TxWitness) *GCSBuilder { return b } - b.AddEntries(witness) - - for _, script := range witness { - b.AddScript(script) - } - - return b + return b.AddEntries(witness) } // Build returns a function which builds a GCS filter with the given parameters