isCoinbaseHash static method

bool isCoinbaseHash(
  1. Uint8List buffer
)

IS coinbase hash

Implementation

static bool isCoinbaseHash(Uint8List buffer) {
  if (buffer.lengthInBytes != 32) {
    throw ArgumentError('Buffer should be 256bit hash.');
  }
  for (int i = 0; i < 32; ++i) {
    if (buffer[i] != 0) return false;
  }
  return true;
}