mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-12 10:58:04 +00:00
Correct log trace for failed script execution.
The function needs to be wrapped by a newLogClosure for the logger to be able to log it.
This commit is contained in:
parent
971fbf8b28
commit
fcd73f75ea
@ -528,12 +528,12 @@ func (s *Script) CheckErrorCondition() (err error) {
|
||||
v, err := s.dstack.PopBool()
|
||||
if err == nil && v == false {
|
||||
// log interesting data.
|
||||
log.Tracef("%v", func() string {
|
||||
log.Tracef("%v", newLogClosure(func() string {
|
||||
dis0, _ := s.DisasmScript(0)
|
||||
dis1, _ := s.DisasmScript(1)
|
||||
return fmt.Sprintf("scripts failed: script0: %s\n"+
|
||||
"script1: %s", dis0, dis1)
|
||||
})
|
||||
}))
|
||||
err = StackErrScriptFailed
|
||||
}
|
||||
if err == nil && len(s.condStack) != 1 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user