Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping("/testnet/**")
- @Controller
- public class TestnetController {
- private NetworkParameters params;
- private WalletAppKit kit;
- public TestnetController() {
- params = TestNet3Params.get();
- kit = new WalletAppKit(params, new File("."), "_") {
- @Override
- protected void onSetupCompleted() {
- if (wallet().getKeychainSize() < 1)
- wallet().addKey(new ECKey());
- }
- };
- kit.startAndWait();
- }
- @RequestMapping(value = "/wallet/{addressVariable}", method = RequestMethod.GET)
- @ResponseBody
- public String walletWatcher(@PathVariable String addressVariable) throws AddressFormatException {
- Address address = new Address(params, addressVariable);
- kit.wallet().addWatchedAddress(address);
- return kit.wallet().toString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement