MCPcopy Create free account
hub / github.com/btcsuite/btcd / NewDebugEngine

Function NewDebugEngine

txscript/engine.go:1713–1728  ·  view source on GitHub ↗

NewEngine returns a new script engine with a script execution callback set. This is useful for debugging script execution.

(scriptPubKey []byte, tx *wire.MsgTx, txIdx int,
	flags ScriptFlags, sigCache *SigCache, hashCache *TxSigHashes,
	inputAmount int64, prevOutFetcher PrevOutputFetcher,
	stepCallback func(*StepInfo) error)

Source from the content-addressed store, hash-verified

1711// NewEngine returns a new script engine with a script execution callback set.
1712// This is useful for debugging script execution.
1713func NewDebugEngine(scriptPubKey []byte, tx *wire.MsgTx, txIdx int,
1714 flags ScriptFlags, sigCache *SigCache, hashCache *TxSigHashes,
1715 inputAmount int64, prevOutFetcher PrevOutputFetcher,
1716 stepCallback func(*StepInfo) error) (*Engine, error) {
1717
1718 vm, err := NewEngine(
1719 scriptPubKey, tx, txIdx, flags, sigCache, hashCache,
1720 inputAmount, prevOutFetcher,
1721 )
1722 if err != nil {
1723 return nil, err
1724 }
1725
1726 vm.stepCallback = stepCallback
1727 return vm, nil
1728}

Callers 1

TestDebugEngineFunction · 0.85

Calls 1

NewEngineFunction · 0.85

Tested by 1

TestDebugEngineFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…