Skip to content

Commit f6d9e0b

Browse files
feat: remove future-segwit warning
BTC-1143
1 parent 3204ec0 commit f6d9e0b

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/address.js

-7
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ const FUTURE_SEGWIT_MIN_SIZE = 2;
1313
const FUTURE_SEGWIT_MAX_VERSION = 16;
1414
const FUTURE_SEGWIT_MIN_VERSION = 1;
1515
const FUTURE_SEGWIT_VERSION_DIFF = 0x50;
16-
const FUTURE_SEGWIT_VERSION_WARNING =
17-
'WARNING: Sending to a future segwit version address can lead to loss of funds. ' +
18-
'End users MUST be warned carefully in the GUI and asked if they wish to proceed ' +
19-
'with caution. Wallets should verify the segwit version from the output of fromBech32, ' +
20-
'then decide when it is safe to use which version of segwit.';
2116
function _toFutureSegwitAddress(output, network) {
2217
const data = output.slice(2);
2318
if (
@@ -33,7 +28,6 @@ function _toFutureSegwitAddress(output, network) {
3328
throw new TypeError('Invalid version for segwit address');
3429
if (output[1] !== data.length)
3530
throw new TypeError('Invalid script for segwit address');
36-
console.warn(FUTURE_SEGWIT_VERSION_WARNING);
3731
if (!network.bech32) {
3832
throw new TypeError("Network doesn't support native segwit");
3933
}
@@ -141,7 +135,6 @@ function toOutputScript(address, network) {
141135
decodeBech32.data.length >= FUTURE_SEGWIT_MIN_SIZE &&
142136
decodeBech32.data.length <= FUTURE_SEGWIT_MAX_SIZE
143137
) {
144-
console.warn(FUTURE_SEGWIT_VERSION_WARNING);
145138
return bscript.compile([
146139
decodeBech32.version + FUTURE_SEGWIT_VERSION_DIFF,
147140
decodeBech32.data,

ts_src/address.ts

-9
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ const FUTURE_SEGWIT_MIN_SIZE: number = 2;
2323
const FUTURE_SEGWIT_MAX_VERSION: number = 16;
2424
const FUTURE_SEGWIT_MIN_VERSION: number = 1;
2525
const FUTURE_SEGWIT_VERSION_DIFF: number = 0x50;
26-
const FUTURE_SEGWIT_VERSION_WARNING: string =
27-
'WARNING: Sending to a future segwit version address can lead to loss of funds. ' +
28-
'End users MUST be warned carefully in the GUI and asked if they wish to proceed ' +
29-
'with caution. Wallets should verify the segwit version from the output of fromBech32, ' +
30-
'then decide when it is safe to use which version of segwit.';
3126

3227
function _toFutureSegwitAddress(output: Buffer, network: Network): string {
3328
const data = output.slice(2);
@@ -49,8 +44,6 @@ function _toFutureSegwitAddress(output: Buffer, network: Network): string {
4944
if (output[1] !== data.length)
5045
throw new TypeError('Invalid script for segwit address');
5146

52-
console.warn(FUTURE_SEGWIT_VERSION_WARNING);
53-
5447
if (!network.bech32) {
5548
throw new TypeError("Network doesn't support native segwit");
5649
}
@@ -178,8 +171,6 @@ export function toOutputScript(address: string, network?: Network): Buffer {
178171
decodeBech32.data.length >= FUTURE_SEGWIT_MIN_SIZE &&
179172
decodeBech32.data.length <= FUTURE_SEGWIT_MAX_SIZE
180173
) {
181-
console.warn(FUTURE_SEGWIT_VERSION_WARNING);
182-
183174
return bscript.compile([
184175
decodeBech32.version + FUTURE_SEGWIT_VERSION_DIFF,
185176
decodeBech32.data,

0 commit comments

Comments
 (0)