Open kulpreet opened 6 years ago
Here's how I would do it
Instead of putting the RR multihash, we include the cid of a multiplexer data structure that is an array of mappings voutIndex: RRMultihash
. Maybe put a chlu_version
field in there as well.
The getTransactionInfo
function in the bitcoin module is called from the validator module. It now returns the multihash of the associated review record and an outputs
array with { index, amount, toAddress }
data structure. I can just change it so that it puts the multihash in the items of the outputs array and the validator gets it from there. The demultiplexing work will be done in the bitcoin module. If it fails, it will just put isChlu: false
in the transaction (it already does if there is no multihash in the OP_RETURN)
The idea is to map vouts to the review record index. We can discuss this later when you are about to implement it.