diff options
Diffstat (limited to 'core/vm/stack.go')
-rw-r--r-- | core/vm/stack.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/vm/stack.go b/core/vm/stack.go index f6c1f76e4..2d1b7bb82 100644 --- a/core/vm/stack.go +++ b/core/vm/stack.go @@ -68,6 +68,11 @@ func (st *Stack) peek() *big.Int { return st.data[st.len()-1] } +// Back returns the n'th item in stack +func (st *Stack) Back(n int) *big.Int { + return st.data[st.len()-n-1] +} + func (st *Stack) require(n int) error { if st.len() < n { return fmt.Errorf("stack underflow (%d <=> %d)", len(st.data), n) |