state: don't spend the "to-us" output from their commit tx.

There's no reason to, it's a simple p2wpkh to our key.

We still spend the "to-us" from our commit tx, since it could be
theoretically be stolen by the revocation value, and it's a complex
p2wsh which a normal wallet won't have the information to spend.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-05-03 11:05:20 +09:30
parent c4713a6ed5
commit eb5d832963
4 changed files with 92 additions and 96 deletions

View File

@@ -1086,7 +1086,7 @@ bool peer_watch_our_htlc_outputs(struct peer *peer,
return false;
}
bool peer_watch_their_htlc_outputs(struct peer *peer,
const struct bitcoin_event *tx,
const struct bitcoin_tx *tx,
enum state_input tous_timeout,
enum state_input tothem_spent,
enum state_input tothem_timeout)
@@ -1222,13 +1222,6 @@ const struct bitcoin_tx *bitcoin_spend_ours(struct peer *peer)
return tx;
}
/* Create a bitcoin spend tx (to spend their commit's outputs) */
const struct bitcoin_tx *bitcoin_spend_theirs(const struct peer *peer,
const struct bitcoin_event *btc)
{
FIXME_STUB(peer);
}
/* Create a bitcoin steal tx (to steal all their commit's outputs) */
const struct bitcoin_tx *bitcoin_steal(const struct peer *peer,
struct bitcoin_event *btc)