From 73ef2bc14aa58403b6297fdd4be035eab90a9a39 Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Mon, 6 Sep 2021 10:30:10 +1000 Subject: [PATCH] Remove comment and use anyhow::context instead --- cfd_protocol/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cfd_protocol/src/lib.rs b/cfd_protocol/src/lib.rs index a734f5c..a1f6097 100644 --- a/cfd_protocol/src/lib.rs +++ b/cfd_protocol/src/lib.rs @@ -236,8 +236,12 @@ pub fn punish_transaction( publish_them_pk: PublicKey, revoked_commit_tx: &Transaction, ) -> Result { - // CommitTransaction has only one input - let input = revoked_commit_tx.input.clone().into_iter().exactly_one()?; + let input = revoked_commit_tx + .input + .clone() + .into_iter() + .exactly_one() + .context("commit transaction inputs != 1")?; let publish_them_sk = input .witness