public StoredBlock build ( Block block ) throws VerificationException { // Stored blocks track total work done in this chain, because the canonical chain is the one that represents // the largest amount of work done not the tallest. BigInteger chainWork = this . chainWork . add ( block . getWork ( ) ) ; int height = this . height + 1 ; return new StoredBlock ( block , chainWork , height ) ; }
Creates a new StoredBlock calculating the additional fields by adding to the values in this block .