Set the ring size for transactions
(wallet *walletapi.Wallet_Disk, s int)
| 1362 | |
| 1363 | // Set the ring size for transactions |
| 1364 | func setRingSize(wallet *walletapi.Wallet_Disk, s int) bool { |
| 1365 | if wallet == nil { |
| 1366 | logger.Errorf("[Engram] No wallet found.\n") |
| 1367 | return false |
| 1368 | } |
| 1369 | |
| 1370 | // Minimum ring size is 2, only accept powers of 2. |
| 1371 | if s < 2 { |
| 1372 | wallet.SetRingSize(2) |
| 1373 | logger.Printf("[Engram] Set minimum ring size: 2\n") |
| 1374 | } else { |
| 1375 | wallet.SetRingSize(s) |
| 1376 | logger.Printf("[Engram] Set default ring size: %d\n", s) |
| 1377 | } |
| 1378 | |
| 1379 | return true |
| 1380 | } |
| 1381 | |
| 1382 | // Check if a username exists, return the registered address if so |
| 1383 | func checkUsername(s string, h int64) (address string, err error) { |