Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] panic: index out of range when checking if script is multisig #185

Open
caevv opened this issue Jan 2, 2024 · 0 comments
Open

[BUG] panic: index out of range when checking if script is multisig #185

caevv opened this issue Jan 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@caevv
Copy link
Contributor

caevv commented Jan 2, 2024

Output 0 https://classic.whatsonchain.com/tx/6148dd49af06ecec4e0f31cf3b1c6f6bb499a8bfab267c93a8b74deb6cf838b5

panic: runtime error: index out of range [0] with length 0
goroutine 33104 [running]:
github.com/libsv/go-bt/bscript.(*Script).IsMultisigOut(0xc002b4ef18?)
	github.com/libsv/[email protected]/bscript/script.go:305 +0xe5

Replicate:

package main

import (
	"github.com/libsv/go-bt"
)

func main() {
	tx, err := bt.NewTxFromString(tx)
	if err != nil {
		panic(err)
	}

	print(tx.GetTxID())

	for _, output := range tx.Outputs {
		output.LockingScript.IsMultisigOut()
	}

}

var tx = "01000000022e131b16fa4d47669b8b3a3054fb0662234372124b6478b9fbcec2430ad17bba010000006a47304402206cb269cc20a402db8eefc5a3249bd86ee868331ed3bd006ecb99c56c751069fe02203536e06213f16b0febc39c7b72092732bfdf3f76a40b4a174b3d7b629ba9d8b74121026e83f3dcd977f6da9d6b349cd8928ae64cf1d5b2584b31144af80eb4e924af86ffffffff9ab6798431849f8f109e3144b6d48a267bee184b5100cca41ad17e98300aec0b000000006a47304402205ba281ed79f25a1ff9b5045b486ea7e412555802c42ea50f107143b3d4781edc02207d2ec6d42087407d072c755618b8ebb43416470261bf571d8511339e66a0a8814121026e83f3dcd977f6da9d6b349cd8928ae64cf1d5b2584b31144af80eb4e924af86ffffffff02e803000000000000084c000400d3016787dcb30100000000001976a91451015d3f83aed2d79c084877dfee20f32769229a88ac00000000"
@caevv caevv added the bug Something isn't working label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant