From c4af4017da3739116cbd044e1a528685144bf3e3 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 31 Dec 2015 00:28:00 -0600 Subject: [PATCH] channeldb: revocation hashes are 20 bytes * Although, why not 32? --- channeldb/channel.go | 2 +- channeldb/channel_test.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/channeldb/channel.go b/channeldb/channel.go index 2d423f57..475b9faf 100644 --- a/channeldb/channel.go +++ b/channeldb/channel.go @@ -78,7 +78,7 @@ type OpenChannel struct { // Current revocation for their commitment transaction. However, since // this is the hash, and not the pre-image, we can't yet verify that // it's actually in the chain. - TheirCurrentRevocation [wire.HashSize]byte + TheirCurrentRevocation [20]byte TheirShaChain *shachain.HyperShaChain OurShaChain *shachain.HyperShaChain diff --git a/channeldb/channel_test.go b/channeldb/channel_test.go index 9bc82a6f..85577fb0 100644 --- a/channeldb/channel_test.go +++ b/channeldb/channel_test.go @@ -31,6 +31,11 @@ var ( 0x2d, 0xe7, 0x93, 0xe4, 0xb7, 0x25, 0xb8, 0x4d, 0x1f, 0xb, 0x4c, 0xf9, 0x9e, 0xc5, 0x8c, 0xe9, } + rev = [20]byte{ + 0x51, 0xb6, 0x37, 0xd8, 0xfc, 0xd2, 0xc6, 0xda, + 0x48, 0x59, 0xe6, 0x96, 0x31, 0x13, 0xa1, 0x17, + 0x2d, 0xe7, 0x93, 0xe4, + } testTx = &wire.MsgTx{ Version: 1, TxIn: []*wire.TxIn{ @@ -146,7 +151,7 @@ func TestOpenChannelEncodeDecode(t *testing.T) { FundingTx: testTx, MultiSigKey: privKey, FundingRedeemScript: script, - TheirCurrentRevocation: id, + TheirCurrentRevocation: rev, OurDeliveryAddress: addr, TheirDeliveryAddress: addr, CsvDelay: 5,