mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-14 03:48:28 +01:00
SPVBlockStore: make sure to use position(int) only from Buffer rather than MappedByteBuffer
Without this cast, on some old JDKs it links against an overloaded method in MappedByteBuffer and Android doesn't have it.
This commit is contained in:
parent
2cdeabf02c
commit
a5aaa8924a
1 changed files with 2 additions and 2 deletions
|
@ -236,9 +236,9 @@ public class SPVBlockStore implements BlockStore {
|
|||
final byte[] zeroPadding = new byte[20]; // 32 (V2 work) - 12 (V1 work)
|
||||
for (int i = currentCapacity - 1; i >= 0; i--) {
|
||||
byte[] record = new byte[RECORD_SIZE_V1];
|
||||
buffer.position(FILE_PROLOGUE_BYTES + i * RECORD_SIZE_V1);
|
||||
((Buffer) buffer).position(FILE_PROLOGUE_BYTES + i * RECORD_SIZE_V1);
|
||||
buffer.get(record);
|
||||
buffer.position(FILE_PROLOGUE_BYTES + i * RECORD_SIZE_V2);
|
||||
((Buffer) buffer).position(FILE_PROLOGUE_BYTES + i * RECORD_SIZE_V2);
|
||||
buffer.put(record, 0, 32); // hash
|
||||
buffer.put(zeroPadding);
|
||||
buffer.put(record, 32, RECORD_SIZE_V1 - 32); // work, height, block header
|
||||
|
|
Loading…
Add table
Reference in a new issue