比特币 解锁脚本signature script 包含了那些东西? 使用 UTXO 需要私钥签名,私钥到底都签了什么东西呢?一直比较好奇. 比特币的私钥签名总共有五中类型,具体见 btcd 代码,如下: // SigHashType represents hash type bits at the end of a signature. type SigHashType uint32 // Hash type bits from the end of a signature. const ( S…
最近发现使用 -z 和 -n 来判断字符串判空,或不空时,很不靠谱. 使用下面的方法最可靠: if [ "x${value}" == "x" ] #为空 then #为空处理 fi if [ "x${value}" != "x" ] #不为空 then #不为空处理 fi 转自 Shell脚本中字符串判空:使用-z 字符串长度为0时,为真,-n字符串长度不为0,为…