doc: document HTLC 2drop optimization.

We can save an opcode in both HTLC send and receive scripts by using
OP_2DROP instead of OP_DROP twice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2015-08-07 12:45:30 +09:30
parent 08ae4a687d
commit 88ca0c91d9
2 changed files with 11 additions and 17 deletions

View File

@ -1906,11 +1906,7 @@ OP_ELSE Must be A, after HTLC has timed out.
\begin_inset space ~
\end_inset
OP_CHECKLOCKTIMEVERIFY
\begin_inset space ~
\end_inset
OP_DROP Ensure (absolute) time has passed.
OP_CHECKLOCKTIMEVERIFY Ensure (absolute) time has passed.
\end_layout
\begin_layout Description
@ -1918,11 +1914,12 @@ OP_DROP Ensure (absolute) time has passed.
\begin_inset space ~
\end_inset
OP_CHECKSEQUENCEVERIFY
\begin_inset space ~
\end_inset
OP_CHECKSEQUENCEVERIFY Delay gives B enough time to use revocation if it
has it.
\end_layout
OP_DROP Delay gives B enough time to use revocation if it has it.
\begin_layout Description
OP_2DROP Drop the delay and htlc-timeout from the stack.
\end_layout
\begin_layout Description
@ -1963,20 +1960,17 @@ OP_IF
\end_layout
\begin_deeper
\begin_layout Description
OP_DROP Remove extra hash
\end_layout
\begin_layout Description
<DELAY>
\begin_inset space ~
\end_inset
OP_CHECKSEQUENCEVERIFY
\begin_inset space ~
\end_inset
OP_CHECKSEQUENCEVERIFY Delay gives A enough time to use revocation if it
has it.
\end_layout
OP_DROP Delay gives A enough time to use revocation if it has it.
\begin_layout Description
OP_2DROP Drop extra hash and delay from the stack
\end_layout
\begin_layout Description

Binary file not shown.