bitpay / bitcore-lib

A pure and powerful JavaScript Bitcoin library
https://bitcore.io/
Other
613 stars 1.03k forks source link

replace OP_NOP2 with OP_CHECKLOCKTIMEVERIFY , add OP_CHECKSEQUENCEVERIFY #143

Closed Cofresi closed 5 years ago

Cofresi commented 7 years ago

Currently, if someone wants to build a script adding OP_CHECKLOCKTIMEVERIFY with bitcore.Script.add('OP_CHECKLOCKTIMEVERIFY'); OP_NOP2 is added to the script, because it is still inside opcode.js having the index 177 as OP_CHECKLOCKTIMEVERIFY. I don't see how this could be intended behaviour. Additionally this adds OP_CHECKSEQUENCEVERIFY to the list of opcodes. This pull request would bring opcode.js to the current state of bitcoin core https://github.com/bitcoin/bitcoin/blob/master/src/script/script.cpp#L132-L133

matiu commented 6 years ago

Concept ACK. Please fix tests.

glen-testing commented 6 years ago

I don't see OP_CHECKSEQUENCEVERFIY in the list of OP codes here: https://github.com/bitpay/bitcore-lib/blob/master/lib/opcode.js Is there anything I can do to help get OP_CHECKSEQUENCEVERIFY included?

If not, am I able to manually input 178 into script transactions as a workaround?

matiu commented 6 years ago

Hi, this is already implemented and merged on the bitcoin-cash branch and we will be backporting it to master this week: https://github.com/bitpay/bitcore-lib/pull/225

matiu commented 5 years ago

https://github.com/bitpay/bitcore-lib/pull/235