| 75 | |
| 76 | template<typename Stream> |
| 77 | void Unser(Stream &s, CScript& script) { |
| 78 | unsigned int nSize = 0; |
| 79 | s >> VARINT(nSize); |
| 80 | if (nSize < nSpecialScripts) { |
| 81 | CompressedScript vch(GetSpecialScriptSize(nSize), 0x00); |
| 82 | s >> Span{vch}; |
| 83 | DecompressScript(script, nSize, vch); |
| 84 | return; |
| 85 | } |
| 86 | nSize -= nSpecialScripts; |
| 87 | if (nSize > MAX_SCRIPT_SIZE) { |
| 88 | // Overly long script, replace with a short invalid one |
| 89 | script << OP_RETURN; |
| 90 | s.ignore(nSize); |
| 91 | } else { |
| 92 | script.resize(nSize); |
| 93 | s >> Span{script}; |
| 94 | } |
| 95 | } |
| 96 | }; |
| 97 | |
| 98 | struct AmountCompression |
nothing calls this directly
no test coverage detected