Get OP_RETURN from bitcoin-cli

0

Is there a way to extract old OP_RETURN transactions from the commandline with bitcoin-cli or something? Something in the way of getAllOpRetFromBlock(345345) ...

D. Hot

Posted 2017-10-06T07:34:40.203

Reputation: 115

Answers

3

There is not quite the method you are looking for, but you can use the getblock call which takes the block hash (not height, you can get the hash of a specific height using getblockhash method). That will give you the block, and you would then need to write a script to iterate through the transactions in the block and find ones which have an OP_RETURN output.

MeshCollider

Posted 2017-10-06T07:34:40.203

Reputation: 8 735