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)
| 1711 | // NewEngine returns a new script engine with a script execution callback set. |
| 1712 | // This is useful for debugging script execution. |
| 1713 | func 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 | } |
searching dependent graphs…