mirror of
https://github.com/bitcoin/bips.git
synced 2025-05-12 12:03:29 +00:00
Update bip-0137.mediawiki
This commit is contained in:
parent
c823bb0638
commit
c6456f1607
@ -88,7 +88,6 @@ Note: this code is a modification of the BitcoinJ code which is written in java.
|
|||||||
// JSON-SPIRIT hands back. Assume UTF-8 for now.
|
// JSON-SPIRIT hands back. Assume UTF-8 for now.
|
||||||
Sha256Hash messageHash = Sha256Hash.twiceOf(messageBytes);
|
Sha256Hash messageHash = Sha256Hash.twiceOf(messageBytes);
|
||||||
boolean compressed = false;
|
boolean compressed = false;
|
||||||
|
|
||||||
// this section is added to support new signature types
|
// this section is added to support new signature types
|
||||||
if(header>= 39) // this is a bech32 signature
|
if(header>= 39) // this is a bech32 signature
|
||||||
{
|
{
|
||||||
@ -104,9 +103,7 @@ Note: this code is a modification of the BitcoinJ code which is written in java.
|
|||||||
compressed = true;
|
compressed = true;
|
||||||
header -= 4;
|
header -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
int recId = header - 27;
|
int recId = header - 27;
|
||||||
|
|
||||||
ECKey key = ECKey.recoverFromSignature(recId, sig, messageHash, compressed);
|
ECKey key = ECKey.recoverFromSignature(recId, sig, messageHash, compressed);
|
||||||
if (key == null)
|
if (key == null)
|
||||||
throw new SignatureException("Could not recover public key from signature");
|
throw new SignatureException("Could not recover public key from signature");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user