From a83dac4e868fbb45ea6dbcef5a0045210b9929b2 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 16 Dec 2015 22:56:11 -0600 Subject: [PATCH] revocation: skeleton for possibly needed method? --- revocation/shachain.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/revocation/shachain.go b/revocation/shachain.go index 9449de093..35de18a3d 100644 --- a/revocation/shachain.go +++ b/revocation/shachain.go @@ -142,6 +142,17 @@ func (h *HyperShaChain) CurrentHash() (*wire.ShaHash, error) { return &h.lastHash, nil } +// LocatePreImage... +// Alice just broadcasted an old commitment tx, we need the revocation hash to +// claim the funds so we don't get cheated. However, we aren't storing all the +// pre-images in memory. So which shachain index # did she broadcast? +func (h *HyperShaChain) LocatePreImage(outputScript []byte) (uint64, *[32]byte) { + // TODO(roasbeef): parallel goroutine divide and conquer? + // * need to know which side it is? also proper keys? + // * guess and check till script template matches the p2sh hash + return 0, nil +} + // MarshallBinary... func (h *HyperShaChain) Encode(b bytes.Buffer) error { return nil