Overview
Comment: | Improvements to block handling |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
7811cddc2ec8ff621f0ba42b855b26cb |
User & Date: | rkeene on 2018-07-02 23:07:11 |
Other Links: | manifest | tags |
Context
2018-07-02
| ||
23:13 | Consolidated some constants check-in: 8670bc6274 user: rkeene tags: trunk | |
23:07 | Improvements to block handling check-in: 7811cddc2e user: rkeene tags: trunk | |
21:24 | Improved checking for entropy sources check-in: 8fd7944e81 user: rkeene tags: trunk | |
Changes
Modified build/test/test.tcl from [6963bbb20e] to [4f0bb6d25d].
︙ | |||
132 133 134 135 136 137 138 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + | puts "\[1.FAIL\] Exp: $pub" return false } set addrCheck [::nano::address::fromPublicKey $pub] if {$addrCheck ne $addr} { |
︙ |
Modified nano.tcl from [ea79113063] to [09538af98b].
︙ | |||
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + | default { return -code error "Invalid block type $block(type)" } } return $blockData } proc ::nano::block::signBlockHash {blockHash key args} { set outputFormat "bytes" foreach arg $args { switch -exact -- $arg { "-hex" { set outputFormat "hex" } "-binary" { set outputFormat "bytes" } } } if {[string length $blockHash] != 32} { set blockHash [binary decode hex $blockHash] } if {[string length $key] != 32} { set key [binary decode hex $key] } set signature [::nano::internal::signDetached $blockHash $key] if {$outputFormat eq "hex"} { set signature [string toupper [binary encode hex $signature]] } return $signature } proc ::nano::block::signBlock {blockData args} { set blockHash [::nano::block::hash $blockData] tailcall ::nano::block::signBlockHash $blockHash {*}$args } proc ::nano::block::verifyBlockHash {blockHash signature pubKey} { if {[string length $blockHash] != 32} { set blockHash [binary decode hex $blockHash] } if {[string length $pubKey] != 32} { set key [binary decode hex $pubKey] } set valid [::nano::internal::verifyDetached $blockHash $signature $pubKey] return $signature } proc ::nano::block::verifyBlock {blockData args} { set blockHash [::nano::block::hash $blockData] tailcall ::nano::block::verifyBlockHash $blockHash {*}$args } proc ::nano::block::_dictToJSON {blockDict} { array set block $blockDict if {[info exists block(signKey)] && ([info exists block(_blockData)] || [info exists block(_blockHash)])} { if {![info exists block(_blockHash)]} { set block(_blockHash) [binary encode hex [::nano::block::hash $block(_blockData)]] } |
︙ |