-
Notifications
You must be signed in to change notification settings - Fork 154
Description
Browserifying https://github.com/Ayms/bitcoin-transactions, everything going well except an unexpected "trivial" issue, calling BN outside of elliptic in https://github.com/Ayms/bitcoin-transactions/blob/master/src/keys.js (see the first function privatekeyderive)
This causes browserify to duplicate twice BN and a call to bn.toBuffer just throws because Buffer is undefined
Not using the latest bn.js version but looking at the code it does not throw now but is just ignored, so if I am correct the "problem" is still there
Suggested fix (or simple workaround instead of making everything available from ec):
if (Buffer===undefined) { Buffer=Uint8Array; };
I don't see what it could harm and to whatever else than Uint8Array Buffer could be derived from if undefined