common: add tal_arr_eq helper.
We do `memeq(a, tal_bytelen(a), b, tal_bytelen(b))` remarkably often... Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
b6cc0ce425
commit
df44431f8c
@@ -205,8 +205,7 @@ int main(int argc, char *argv[])
|
||||
wscript = bitcoin_redeem_2of2(ctx, &local_fundingkey, &remote_fundingkey);
|
||||
expect_scriptpubkey = scriptpubkey_p2wsh(ctx, wscript);
|
||||
|
||||
if (!memeq(expect_scriptpubkey, tal_bytelen(expect_scriptpubkey),
|
||||
scriptpubkey, tal_bytelen(scriptpubkey))) {
|
||||
if (!tal_arr_eq(expect_scriptpubkey, scriptpubkey)) {
|
||||
printf("*** FATAL *** outscript %s should be %s\n",
|
||||
tal_hex(ctx, scriptpubkey),
|
||||
tal_hex(ctx, expect_scriptpubkey));
|
||||
|
||||
Reference in New Issue
Block a user