Branch: refs/heads/master
  Home:   https://github.com/btcsuite/btcd
  Commit: d6105893af2356ba3dbded0e16a0900ac5747c16
      
https://github.com/btcsuite/btcd/commit/d6105893af2356ba3dbded0e16a0900ac5747c16
  Author: Dave Collins <[email protected]>
  Date:   2015-04-23 (Thu, 23 Apr 2015)

  Changed paths:
    M txscript/engine.go
    M txscript/opcode.go

  Log Message:
  -----------
  txscript: Improve conditional stack.

This commit improves the way the conditional execution stack is handled in
a few ways.

First, the current execution state is now pushed onto the end of the slice
rather than the front of it.  This has been done because it results in
fewer allocations and is therefore more efficient.

Second, the need for allocating and setting an initial true in the
conditional stack has been eliminated.  The vast majority of scripts don't
contain any conditionals, so there is no reason to allocate a slice when
it isn't needed.

Third, a new function has been added to the engine to determine if the
current conditional branch is executing named isBranchExecuting which
handles the fact the conditional execution stack can now be empty and
improves the readability of the code.

Finally, it removes a couple of TODOs which I have verified do not apply.


Reply via email to