mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

Fix overview SP update, add autorefresh every 7s #175

Closed zathras-crypto closed 9 years ago

dexX7 commented 9 years ago

This is great, but maybe I misunderstand what's happening here.

It's a perfect topic to ask what I was wondering about recently: is there a way which doesn't require pulling data to check for something new, but to receive a signal (similar to -blocknotify) when a new Mastercoin transaction arrived? I guess hooking into mastercore_handler_tx(), interpretPacket(), recordTX() or so might be a starting point?

And if there is such a mechanism, could this be used instead of refreshing every 7 seconds, if checking for a new state is the reason why this done?

zathras-crypto commented 9 years ago

Well, I'd like to be a lot cleaner than this for starters - this is just a 'hammer' approach to avoid stale data.

I'm hooked into the balance signals for BTC, since every MSC transaction must inherently send or receive some BTC, that's the main update refresh mechanism.

We could potentially do what you suggest - though it's effectively available now with combination calls (blocknotify followed by listblocktransactions_MP with the new block number to check if any MP txs in the last block, or walletnotify for ping for wallet specific txs followed by a gettransaction_MP to see if it was a MP tx).