lbryio / lbrycrd

The blockchain that provides the digital content namespace for the LBRY protocol
https://lbry.com
MIT License
2.57k stars 178 forks source link

Add supports on getclaimbyid RPC command #124

Closed shyba closed 6 years ago

shyba commented 6 years ago

getclaimbyid calculates the effective amount, but doesn't returns the supports list. Supports are needed for our electrum layer. For getting it we actually need to call getclaimsforname, which transfer more data then needed and adds an extra call.

@lbrynaut proposed a new index for supports over claim ids. I think it's the way to go, but we should discuss here.

I have some very ugly proof of concept here with a new JSON format for it: https://github.com/shyba/lbrycrd/commit/2fdd202cbf0908ca9441e6edbd6e667ce5c9a7a1

Some other idea was to make the support listing optional with an extra boolean parameter like includeSupports.

lbrynaut commented 6 years ago

@shyba Thanks for filing this. After the claimindex PR (#110) is merged, I'll start by making supports returned from the appropriate methods to avoid calling (effectively) the same things multiple times.

shyba commented 6 years ago

@lbrynaut something I also had to add but is pretty simple, maybe not worth another issue: claim.push_back(Pair("valid at height", claimValue.nValidAtHeight));