| 191 | } |
| 192 | |
| 193 | void add_to_transaction(cson_value *val) |
| 194 | { |
| 195 | const char *cnonce = get_strprop(val, "cnonce"); |
| 196 | const char *type = get_strprop(val, "type"); |
| 197 | |
| 198 | auto it = transactions.find(cnonce); |
| 199 | if (it == transactions.end()) { |
| 200 | if (verbose) |
| 201 | std::cout << "new transaction " << cnonce << std::endl; |
| 202 | std::list<cson_value*> statements; |
| 203 | statements.push_back(val); |
| 204 | transactions.insert(std::pair<std::string, std::list<cson_value*>>(cnonce, statements)); |
| 205 | } else { |
| 206 | auto &list = (*it).second; |
| 207 | if (verbose) |
| 208 | std::cout << "add to existing transaction " << cnonce << " size=" << list.size() << std::endl; |
| 209 | list.push_back(val); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /* out should be appropriately sized */ |
| 214 | void fromhex(uint8_t *out, const uint8_t *in, size_t len) |
no test coverage detected