mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +03:00
Merge pull request #5475 from dasrun-fadben/bitcoin-compact-size
bitcoin-utils: Fix parsing of of CompactSize integers
This commit is contained in:
commit
08c95f2b6f
@ -143,6 +143,7 @@
|
|||||||
|= a=@
|
|= a=@
|
||||||
^- hexb
|
^- hexb
|
||||||
=/ l=@ (met 3 a)
|
=/ l=@ (met 3 a)
|
||||||
|
?: =(l 0) 1^a
|
||||||
?: =(l 1) 1^a
|
?: =(l 1) 1^a
|
||||||
?: =(l 2) (cat:byt ~[1^0xfd (flip:byt 2^a)])
|
?: =(l 2) (cat:byt ~[1^0xfd (flip:byt 2^a)])
|
||||||
?: (lte l 4) (cat:byt ~[1^0xfe (flip:byt 4^a)])
|
?: (lte l 4) (cat:byt ~[1^0xfe (flip:byt 4^a)])
|
||||||
@ -162,7 +163,7 @@
|
|||||||
%0xfe 2
|
%0xfe 2
|
||||||
%0xff 3
|
%0xff 3
|
||||||
==
|
==
|
||||||
:_ (drop:byt (add 1 len) h)
|
:_ (drop:byt (add 1 (bex len)) h)
|
||||||
%- flip:byt
|
%- flip:byt
|
||||||
(take:byt (bex len) (drop:byt 1 h))
|
(take:byt (bex len) (drop:byt 1 h))
|
||||||
:: +dea: atom instead of hexb for parsed CompactSize
|
:: +dea: atom instead of hexb for parsed CompactSize
|
||||||
|
Loading…
Reference in New Issue
Block a user